Harryxun/stf_run huggingface dataset:
x,n=map(int,input().split())
if n==0:
  print(x)
else:
  a=list(map(int,input().split()))

  dtmp=100
  for i in range(1,100):
    continueflag=0
    for j in a:
      if j==i:
        continueflag=1
        break
    if continueflag==1:
      continue
    d=abs(x-i)
    if d<dtmp:
      dtmp=d
      ans=i

  print(ans)
    

### FIXED CODE ###

x,n=map(int,input().split())
if n==0:
  print(x)
else:
  a=list(map(int,input().split()))
  flag=0
  i=0
  while flag==0:
    continueflag=0
    for j in range(n):
      if a[j]==x-i:
        continueflag=1
        break
    if continueflag==0:
      print(x-i)
      break
      
    continueflag=0
    for j in range(n):
      if a[j]==x+i:
        continueflag=1
        break
    if continueflag==0:
      print(x+i)
      break
    i=i+1
n, m = input().split()
num_s = int(n)
num_c = int(m)

if num_c <= num_s * 2:
  print(num_c // c)
else:
  scc = num_s
  num_s = 0
  num_c -= 2 * scc
  scc += num_c // 4
  print(scc)



### FIXED CODE ###

n, m = input().split()
num_s = int(n)
num_c = int(m)

if num_c <= num_s * 2:
  # Sが多いとき
  print(num_c // 2)
else:
  scc = num_s
  num_s = 0
  num_c -= 2 * scc
  scc += num_c // 4
  print(scc)
H,W = map(int,input().split(' '))
S = []
for i in [0]*H:
	l = input()
	S.append([1 if x == '#' else -1 for x in l])

bk = 0
wh = 0
def check(S,x,y):
	global bk
	global wh
	if S[y][x] == 0:
		return
	if S[y][x] == 1:
		bk += 1
		S[y][x]=0
		if 0 < y and S[y-1][x] == -1:
			check(S,x,y-1)
		if 0 < x and S[y][x-1] == -1:
			check(S,x-1,y)
		if y < H-1 and S[y+1][x] == -1:
			check(S,x,y+1)
		if x < W-1 and S[y][x+1] == -1:
			check(S,x+1,y)
		return
	if S[y][x] == -1:
		wh += 1
		S[y][x]=0
		if 0 < y and S[y-1][x] == 1:
			check(S,x,y-1)
		if 0 < x and S[y][x-1] == 1:
			check(S,x-1,y)
		if y < H-1 and S[y+1][x] == 1:
			check(S,x,y+1)
		if x < W-1 and S[y][x+1] == 1:
			check(S,x+1,y)
		return

cnt = 0
for y in range(H):
	for x in range(W):
		if S[y][x] == 1:
			check(S,x,y)
			cnt += wh*bk
			wh = 0
			bk = 0
print(cnt)




### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

H,W = map(int,input().split(' '))
S = []
for i in [0]*H:
	l = input()
	S.append([1 if x == '#' else -1 for x in l])

bk = 0
wh = 0
def check(S,x,y):
	global bk
	global wh
	if S[y][x] == 0:
		return
	if S[y][x] == 1:
		bk += 1
		S[y][x]=0
		if 0 < y and S[y-1][x] == -1:
			check(S,x,y-1)
		if 0 < x and S[y][x-1] == -1:
			check(S,x-1,y)
		if y < H-1 and S[y+1][x] == -1:
			check(S,x,y+1)
		if x < W-1 and S[y][x+1] == -1:
			check(S,x+1,y)
		return
	if S[y][x] == -1:
		wh += 1
		S[y][x]=0
		if 0 < y and S[y-1][x] == 1:
			check(S,x,y-1)
		if 0 < x and S[y][x-1] == 1:
			check(S,x-1,y)
		if y < H-1 and S[y+1][x] == 1:
			check(S,x,y+1)
		if x < W-1 and S[y][x+1] == 1:
			check(S,x+1,y)
		return

cnt = 0
for y in range(H):
	for x in range(W):
		if S[y][x] == 1:
			check(S,x,y)
			cnt += wh*bk
			wh = 0
			bk = 0
print(cnt)
import math
a,b = map(int, input().split())
print(a * b // math.gcd(a,b))

### FIXED CODE ###

import fractions
a,b = map(int, input().split())
k = fractions.gcd(a,b)
print(a * b // k)
m = int(input())
a = list( map( int, input().split() ) )
b1 = a[0]
b2 = a[0]
for i in range(m):
  if a[i] > b1:
    b1 = a[i]
  elif a[i] < b2:
    b2 = a[i]
print(b1-b2)

### FIXED CODE ###

m = int(input())
if m %2 == 1:res = m*2
else:res = m
print(res)
import math

A,B,H,M = map(int, input().split())

h = H/6
n = M/30

CC = A**2 + B**2 + 2*A*B*math.cos((h-n)*math.pi)\  
C= math.sqrt(CC)

print(CC)
print(C)

### FIXED CODE ###

n = int(input())
b = n%10

if b == 3:
  print('bon')
elif b == 1 or b == 6 or b ==8 or b == 0:
  print('pon')
else:
  print('hon')
dict = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000}

while True:
    try:
        roman = raw_input()
        sum = 0
        value = 1000
        for i in range(len(roman)):
            if value >= dict[roman[i]]:
                value = dict[roman[i]]
                sum += value
            elif:
                sum -= 2*value
                value = dict[roman[i]]
                sum += value
        print sum
    except:
        break

### FIXED CODE ###

dict = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000}

while True:
    try:
        roman = raw_input()
        sum = 0
        value = 1000
        for i in range(len(roman)):
            if value >= dict[roman[i]]:
                value = dict[roman[i]]
                sum += value
            else:
                sum -= 2*value
                value = dict[roman[i]]
                sum += value
        print sum
    except:
        break
N,M = (int(i) for i in input().split())

student = []
for i in range(N):
    a,b = (int(k) for k in input().split())
    student.append([a,b])

points = []
for i in range(M):
    c,d = (int(k) for k in input().split())
    points.append([a,b])
    
distance = []
kyori = []


for i in range(N):
    for j in range(1):
        kyori.append(abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1]))
    distance.append(min(kyori[j]))

for i in range(N):
    for j in range(1,M):
        kyori[j] = abs(student[i][0]-points[j][0]) + abs(student[i][1]-points[j][1])
    distance.append(min(kyori[j]))

for i in range(N):
    print(distance[i])

### FIXED CODE ###

N,M = (int(i) for i in input().split())
a=[]
b=[]
c=[]
d=[]

for i in range(N):
    A,B = (int(i) for i in input().split())
    a.append(A)
    b.append(B)

for i in range(M):
    C,D = (int(i) for i in input().split())
    c.append(C)
    d.append(D)


closest = N*[0]

for i in range(N):
    minimum = abs(a[i]-c[0])+abs(b[i]-d[0])
    number = 1
    for j in range(1,M):
        distance = abs(a[i]-c[j])+abs(b[i]-d[j])
        if distance < minimum:
            minimum = distance
            number = j+1
    closest[i] = number

for i in range(N):
    print(closest[i])
n = int(input())
v_li = list(map(int,input().split()))
c_li = list(map(int,input().split()))
ben = []
for i in range(n):
  b = v_li[i]-c_li[i]
  ben.append(b)
ben.sort()
ben.reverse()
ans = 0
j = 0
while ben[j]>=0:
  ans+= ben[j]
  j +=1
print(ans)

### FIXED CODE ###

n = int(input())
v_li = list(map(int,input().split()))
c_li = list(map(int,input().split()))
ben = []
for i in range(n):
  b = v_li[i]-c_li[i]
  ben.append(b)
ben.sort()
ben.reverse()
ans = 0
for i in range(n):
  if ben[i] >0:
    ans+=ben[i]
  else:
    break
print(ans)
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

#n,m = [int(i) for i in readline().split()]
#d = [int(i) for i in readline().split()]
MOD = 10**9+7

n = int(input())
a = [int(i) for i in readline().split()]

#m = 1000000
#a = list(range(m,m+2000))

from math import gcd
m = a[0]
for i in a:
    m = m//gcd(m,i)*i

ans = 0
for i in a:
    ans += (m//i)%MOD

print(ans%MOD)




### FIXED CODE ###

def Eratosthenes(N): #N以下の素数のリストを返す
    #iが素数のときis_prime_list[i]=1，それ以外は0
    N+=1
    is_prime_list = [True]*N
#    is_prime_list[0], is_prime_list[1] = False, False #リストが必要なときはこの2行を有効化
#    for j in range(4,N,2): is_prime_list[j] = False
    m = int(N**0.5)+1
    for i in range(3,m,2):
        if is_prime_list[i]:
            is_prime_list[i*i::2*i]=[False]*((N-i*i-1)//(2*i)+1)
    return [2] + [i for i in range(3,N,2) if is_prime_list[i]]
#    return is_prime_list


# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

#n,m = [int(i) for i in readline().split()]
#d = [int(i) for i in readline().split()]
MOD = 10**9+7

n = int(input())
a = [int(i) for i in readline().split()]

#m = 1000000
#a = list(range(m,m+2000))

from fractions import gcd
m = a[0]
for i in a:
    m = m//gcd(m,i)*i

ans = 0
M = m%MOD
for i in a:
    ans += M*pow(i,MOD-2,MOD)%MOD

print(ans%MOD)
from collections import defaultdict

n, q = map(int, input().split())
tree = defaultdict(list)
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a].append(b)

res = [0]*(n+1)

def add_x(p, x):
    res[p] += x
    for child in tree[p]:
        add_x(child, x)

for _ in range(q):
    p, x = map(int, input().split())
    add_x(p, x)

print(' '.join(list(map(str, res[1:]))))

### FIXED CODE ###

import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()
N = int(input())
items = []
for _ in range(N):
    item = int(input())
    items.append(item)

items.sort()

print(int(sum(items[0:N-1]) + items[N]/2))

### FIXED CODE ###

N = int(input())
items = []
for _ in range(N):
    item = int(input())
    items.append(item)

items.sort()

print(int(sum(items[0:N-1]) + items[-1]/2))
import bisect
n, k = map(int, input().split())
a = [int(input()) for _ in range(n)]
dp = [1 for _ in range(n)]
for i in range(n):
    for j in range(i-1, -1, -1):
        if abs(a[i] - a[j]) <= k:
            dp[i] = max(dp[i], dp[j]+1)
print(dp[-1])

### FIXED CODE ###

print("ACL"*int(input()))
import sys,math
n=int(input())
a=list(map(int,input().split()))
numbers={}
flag=0
for i in range(n):
  if a[i] in numbers:
    numbers[a[i]]+=1
  else:
    numbers[a[i]]=1
while pointer in range(2,10**6+1):
  count=0
  pointer2=pointer
  while pointer2<10**6+1:
    if pointer2 in numbers:
      count+=numbers[pointer2]
    pointer2+=pointer
  if count>=2:
    flag=1
    break
if flag==0:
  print('pairwise coprime')
  sys.exit()
ans=a[0]
for i in range(1,n):
  ans=math.gcd(a[i],ans)
if ans==1:
  print('setwise coprime')
else:
  print('not coprime')


### FIXED CODE ###

import sys,math
n=int(input())
a=list(map(int,input().split()))
sieve=[0]*(10**6+1)
numbers={}
flag=0
for i in range(n):
  if a[i] in numbers:
    numbers[a[i]]+=1
  else:
    numbers[a[i]]=1
pointer=2
while pointer<10**6+1:
  if sieve[pointer]==1:
    pointer+=1
    continue
  count=0
  pointer2=pointer
  while pointer2<10**6+1:
    if pointer2 in numbers:
      count+=numbers[pointer2]
    sieve[pointer2]=1
    pointer2+=pointer
  if count>=2:
    flag=1
    break
if flag==0:
  print('pairwise coprime')
  sys.exit()
ans=a[0]
for i in range(1,n):
  ans=math.gcd(a[i],ans)
if ans==1:
  print('setwise coprime')
else:
  print('not coprime')
# 判定機にmathがインストールされていないため、
# gcd=最小公倍数、lcm=最少公約数(返り値整数)を実装
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    z = None
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        return z


def lcm(m, n):
    return (m * n) // gcd(m, n)


# input
A, B, C, D = map(int, input().split())

# check
AB = len(list(range(A, B + 1)))

C_cnt = B // C - (A - 1) // C
D_cnt = B // D - (A - 1) // C

lcm_CD = lcm(C, D)
lcm_cnt = B // lcm_CD - (A - 1) // lcm_CD

print(AB - C_cnt - D_cnt + lcm_cnt)

### FIXED CODE ###

# 判定機にmathがインストールされていないため、
# gcd=最小公倍数、lcm=最少公約数(返り値整数)を実装
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    z = None
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        return z


def lcm(m, n):
    return (m * n) // gcd(m, n)


# input
A, B, C, D = map(int, input().split())

# check
AB = B - (A - 1)

C_cnt = B // C - (A - 1) // C
D_cnt = B // D - (A - 1) // D

lcm_CD = lcm(C, D)
lcm_cnt = B // lcm_CD - (A - 1) // lcm_CD

ans = AB - C_cnt - D_cnt + lcm_cnt

print(ans)
import sys
sys.setrecursionlimit(10 ** 4)

n = int(input())
h = [int(x) for x in input().split()]
dp = [-1 for _ in range(n)]


def rec_dp(i: int) -> int:
    global h, dp
    if i == 0:
        return 0
    if dp[i] != -1:
        return dp[i]
    res = rec_dp(i - 1) + abs(h[i] - h[i - 1])
    if i - 2 >= 0:
        res = min(rec_dp(i - 2) + abs(h[i] - h[i - 2]), res)
    dp[i] = res
    return res


print(rec_dp(n - 1))


### FIXED CODE ###

INF = 10 ** 9
N = int(input())
h = [int(x) for x in input().split()]

dp = [INF] * N
dp[0] = 0

for i in range(N - 1):
    for j in range(1, 3):
        if i + j < N:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))

print(dp[N - 1])
#include <stdio.h>

int main()
{
    int s;
    scanf("%d", &s);
    double a = s / 3600;
    double b = a / 60;
    double c = b / 60;
    printf("%d:%d:%d\n", int(a), int(b), int(c));
    return 0;
}


### FIXED CODE ###

s = int(input())
a, b = divmod(s, 60)
c, d = divmod(a, 60)
print("{}:{}:{}".format(c, d, b))
s, ans = raw_input(), 0
for i in range(len(s) - 1):
    if (len(set(s[i : i + 2))) == 2):
        cnt += 1
print cnt

### FIXED CODE ###

s, ans = raw_input(), 0
for i in range(len(s) - 1):
    if (len(set(s[i : i + 2])) == 2):
        ans += 1
print ans
import sys
n=int(input())
if n==1:
    print(1)
    sys.exit()
k=2
ans=0
while k*2<=n:
    k*=2
    ans+=1
print(k)

### FIXED CODE ###

import sys
a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
    print(0)
    sys.exit()
if a%2==0 and a==b==c:
    print(-1)
    sys.exit()
while a%2==0 and b%2==0 and c%2==0:
    ta=a/2
    tb=b/2
    tc=c/2
    a=tb+tc
    b=ta+tc
    c=ta+tb
    ans+=1
print(ans)
n = int(input())

s = []
for i in range(n):
  s.append(sorted(input()))

print(n - len(set(s)))

### FIXED CODE ###

import collections  

n = int(input())

s = []
for i in range(n):
    s.append(str(sorted(input())))

cnt = 0
for (c, m) in collections.Counter(s).items():
    cnt += m * (m - 1) // 2
    
print(cnt)
a, b = int (input().split())
c = a*b % 2
if c=0 :
 print("Even")
else:
 print("Odd")


### FIXED CODE ###

a, b =map( int, input().split())
c = a*b % 2
if c==0 :
 print("Even")
else :
 print("Odd")
while B <= A:
    B = B * 2
    N = N + 1

while C <= B:
    C = C * 2
    N = N + 1

if K >= N:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

A, B, C = list(map(int, input().split())) 
K = int(input())
N = 0

while B <= A:
    B = B * 2
    N = N + 1

while C <= B:
    C = C * 2
    N = N + 1

if K >= N:
    print('Yes')
else:
    print('No')
N = int(input())
nn = str(N)
n = len(nn)
ans = []

for i in range(n):
    waru = N % 10
    N = int(N / 10)  
    ans.append(waru)


Sans = sum(ans)       
if Sans % 9 == 0:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N = input()
ans = []

for i in range(len(N)):
    ans.append(N[i])


ys = map((lambda x: int(x)), ans)
Sans = sum(ys)

if Sans % 9 == 0:
    print("Yes")
else:
    print("No")
from math import floor
from decimal import Decimal

S = list(input())
T = list(input())

isSuccess = False

for i in reversed(range(len(S) - len(T) + 1)):
    T_str = S[i: i + len(T)]
    for j in range(len(T)):
        if T_str[j] != T[j] and T_str[j] != "?":
        break
    else:
        isSuccess = True
        S[i:i + len(T)] = T
        break
if isSuccess == False:
    print("UNRESTORABLE")
else:
    string = ",".join(S)
    string = string.replace('?', 'a')
    S = string.split(',')
    print("".join(map(str,S)))

### FIXED CODE ###

from math import floor
from decimal import Decimal

S = list(input())
T = list(input())

isSuccess = False

for i in reversed(range(len(S) - len(T) + 1)):
    T_str = S[i: i + len(T)]
    for j in range(len(T)):
        if T_str[j] != T[j] and T_str[j] != "?":
        	break
    else:
        isSuccess = True
        S[i:i + len(T)] = T
        break
if isSuccess == False:
    print("UNRESTORABLE")
else:
    string = ",".join(S)
    string = string.replace('?', 'a')
    S = string.split(',')
    print("".join(map(str,S)))
n,m=map(int,input().split())
vis,ci,cb,cc=[0]*(n+1),0,0,0
g=[[] for i in range(n+1)]
def dfs(x,col):
	if vis[x]:
		return vis[x]==col
	vis[x],flag=col,True
	for i in g[x]:
		flag&=dfs(i,3-col)
	return flag
for i in range(m):
	u,v=map(int,input().split())
	g[u]+=[v]
	g[v]+=[u]
for i in range(1,n+1):
	if vis[i]==0:
		if len(g[i])==0:
			ci+=1
		else:
			if dfs(i,1):
				cb+=1
			else:
				cc+=1
print(ci*ci+2*ci*(n-ci)+cc*cc+2*cb*cc+2*cb*cb)

### FIXED CODE ###

import queue
n,m=map(int,input().split())
vis,ci,cb,cc=[0]*(n+1),0,0,0
g=[[] for i in range(n+1)]
def dfs(x):
	stk,flag=queue.LifoQueue(),True
	stk.put((x,1))
	while not stk.empty():
		u,col=stk.get()
		if vis[u]:
			flag&=(vis[u]==col)
			continue
		vis[u]=col
		for i in g[u]:
			stk.put((i,3-col))
	return flag
for i in range(m):
	u,v=map(int,input().split())
	g[u]+=[v]
	g[v]+=[u]
for i in range(1,n+1):
	if vis[i]==0:
		if len(g[i])==0:
			ci+=1
		else:
			if dfs(i):
				cb+=1
			else:
				cc+=1
print(ci*ci+2*ci*(n-ci)+cc*cc+2*cb*cc+2*cb*cb)
import sys
n=int(input())
d=list(map(int,input().split()))
d.sort()
mx=d[-1]
count=[0]*(mx+1)
j=0
MOD=998244353
if d[0]!=0:
    print(0)
    sys.exit()
count[0]=1
j=1
for i in range(1,n):
    if d[i]==j:
        count[j]+=1
    elif d[i]==j+1 and count[i]>0:
        j+=1
        count[j]+=1
    else:
        print(0)
        sys.exit()
c=1
#print(d,count)
for i in range(1,mx+1):
    c*=pow(count[i-1],count[i],MOD)
    c%=MOD
print(c)

### FIXED CODE ###

import sys
n=int(input())
d=list(map(int,input().split()))
if d[0]!=0:
    print(0)
    sys.exit()
d.sort()
mx=d[-1]
count=[0]*(mx+1)
MOD=998244353
for i in range(n):
    count[d[i]]+=1
c=1
#print(d,count)
if count[0]!=1:
    print(0)
    sys.exit()
for i in range(1,mx+1):
    c*=pow(count[i-1],count[i],MOD)
    c%=MOD
print(c)
n = int(input())
AL = [chr(ord('a') + i) for i in range(26)]

def number_to_alphabet(n):
    N = n-1
    a = ''
    while True:
        d = N % 26
        a = AL[d]+ a
        if N = 0: break
        N = N//26-1
        if N < 0: break
    return a

print(number_to_alphabet(n))



### FIXED CODE ###

n = int(input())
AL = [chr(ord('a') + i) for i in range(26)]

def number_to_alphabet(n):
    N = n-1
    a = ''
    while True:
        d = N % 26
        a = AL[d]+ a
        if N == 0: break
        N = N//26-1
        if N < 0: break
    return a

print(number_to_alphabet(n))
N, K, L = map(int, input().split())

par = [i for i in range(N)]
size = [1] * N


def find(x, P):
    if P[x] == x:
        return x
    else:
        return find(P[x], P)

def unite(x, y):
    x = find(x, par)
    y = find(y, par)

    if x != y:
        # xとyの属している集合が異なる時
        par[x] = y

par2 = [i for i in range(N)]
def unite2(x, y):

    x = find(x, par2)
    y = find(y, par2)

    if x != y:
        # xとyの属している集合が異なる時
        par2[x] = y
        s = size[x] + size[y]
        size[y] = s

for _ in range(K):
    p, q = map(int, input().split())
    unite(p-1, q-1)

### FIXED CODE ###

from collections import Counter

n,k,l=map(int,input().split())
city1=[i for i in range(n)]
city2=[i for i in range(n)]

def root(c,x):
  if x==c[x]:
    return x
  else:
    c[x]=root(c,c[x])
    return c[x]

def union(c,x,y):
  rx=root(c,x)
  ry=root(c,y)
  if rx>ry:
    c[rx]=ry
  else:
    c[ry]=rx

for i in range(k):
  a,b=map(int,input().split())
  union(city1,a-1,b-1)
for i in range(l):
  a,b=map(int,input().split())
  union(city2,a-1,b-1)
r=[]
for i in range(n):
  r.append((root(city1,i),root(city2,i)))
c=Counter(r)
for i in range(n):
  ans=c[r[i]]
  if i==n-1:
    print(ans)
  else:
    print(ans,end=' ')
A,B = map(int, input().split())
if A==B:
  print("draw")
elif A == 1 or (b != 1 and A>B):
  print("Alice")
else:
  print("Bob");


### FIXED CODE ###

A,B = map(int, input().split())
if A==B:
  print("Draw")
elif A == 1 or (B != 1 and A>B):
  print("Alice")
else:
  print("Bob")
S=input()
T=sorted(S.split())
print("Yes" if T[0] == T[1] and T[2]=T[3] and T[0] != T[2] else "No")

### FIXED CODE ###


T=sorted(input())
print("Yes" if T[0] == T[1] and T[2] == T[3] and T[0] != T[2] else "No")
#coding:utf-8
import fractions
a = int(input())
b = int(input())
print( a * b // fractions.gcd(a, b))


### FIXED CODE ###

#coding:utf-8
import fractions
a,b = map(int,input().split())
print( a * b // fractions.gcd(a, b))
import math 
import bisect
import heapq
from collections import deque

h,w = map(int,input().split())
s = [map(int,input().split()) for _ in range(h)]
v = [ [0] * w ] * h

def bfs(i,j,s,v,count):

    if s[i][j] == '#': return 0
    else:
        v[i][j] = 1
        if i+1 < h and j+1 < w :
            if v[i+1][j+1] != 1 and s[i+1][j+1] == '.':
                count += 1
                bfs(i+1,j+1,s,v,count)

        elif i+1 < h and j-1 > 0 :
            if v[i+1][j-1] != 1 and s[i+1][j-1] == '.':
                count += 1
     
                bfs(i+1,j-1,s,v,count)

        elif i-1 < h and j+1 > 0 :
            if v[i-1][j+1] != 1 and s[i-1][j+1] == '.':
                count += 1
       
                bfs(i-1,j+1,s,v,count)

        elif i-1 < h and j-1 > 0 :
            if v[i+1][j-1] != 1 and s[i-1][j-1] == '.':
                count += 1
               
                bfs(i-1,j-1,s,v,count)

        else :return count

ans = 0
for i in range(h):
    for j in range(w):
        x,y = i,j
        ans = max(ans,bfs(i,j,s,v,0))

print(ans)

### FIXED CODE ###

import math 
import bisect
import heapq
from collections import deque

h,w=map(int,input().split())
M=[]
M=[input() for _ in range(h)]
 
def bfs(x,y):
    dist=[[-1]*w  for _ in range(h)]
    seen=[[False]*w for _ in range(h)]
    stk=[(x,y,0)]
    while stk:
        px,py,dst=stk.pop(0)
        if seen[px][py]:
            continue
        seen[px][py]=True
        
        if M[px][py]=='#':
            dist[px][py]=0
            continue
        
        for x,y in [(-1,0),(1,0),(0,-1),(0,1)]:
            if px+x<0 or px+x>=h or py+y<0 or py+y>=w:
                continue
            else:
                stk.append((px+x,py+y,dst+1))
        dist[px][py]=dst
    ans=0
 
    for i in range(h):
        ans=max(max(dist[i]),ans)
    return ans
ans = 0
for i in range(h):
    for j in range(w):
        if M[i][j]=='#':
            continue
        ans=max(bfs(i,j),ans)
print(ans)
n = int(input())
a = []
for i in range(0, n - 1):
    a.append(int(input()))

for i in range(1, n +1):
    print(a.count(i))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

result = [0 for _ in range(n)]
for i in range(n - 1):
    result[a[i]-1] += 1

for v in result:
    print(v)
n=int(input())
a= list(map(int,input().split()))

#for i in a:
#i=0
b=[0]*(max(a)+2)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1
print(max(b-1))

### FIXED CODE ###

n=int(input())
a= list(map(int,input().split()))

#for i in a:
#i=0
b=[0]*(10**5+10)
r=0
#while i<=n:
for i in a:
    b[i]+=1
    b[i+1]+=1
    b[i+2]+=1

print(max(b))
N = int(input())
lis = []
[lis.append(input()) for i in range(N)]

tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

### FIXED CODE ###

import collections

N = int(input())
cnt_dic = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt_dic[s] += 1

max_v = max(cnt_dic.values())

ans_lis = [k for k, v in cnt_dic.items() if v == max_v]

for s in sorted(ans_lis):
  print(s)