peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
s=list(input())
li=[]
non=False
for c in s:
  if c in li:
    non=True
    break
  li.append(c)
    
if non:
  print("no")
  
else:
  print("yes")
# Judge status: Accepted
from math import floor
A, B = map(int, input().split())

def check(x):
    if floor(x*0.08) == A and floor(x*0.1) == B:
        return True
    return False

x = 1
while(x < 1251):
    if check(x):
        break
    x += 1

if x == 1251:
    print(-1)
else:
    print(x)
# Judge status: Wrong Answer
import numpy as np
from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

input()
nums = np.array(list(map(int, input().split())), dtype=np.int64)

total = 0
for num in lcm_list(nums) / nums:
    total += int(num) % (10**9 + 7)
    total %= (10**9 + 7)
print(total)
# Judge status: Accepted
a,b,c = map(int,input().split())
if 2*b == a + c:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
# thought greedy was better i am noob
# classical problem no explanation needed
def main():
	n = int(input())
	dp = [0 for i in range(n+4)]
	dp[0]=0
	for i in range(1, n+2):
		p = 1
		dp[i]=1000000000000000
		while i>=p:
			dp[i]=min(dp[i] , dp[i-p]+1)
			p =p*9
		p=1
		while i>=p:
			dp[i]=min(dp[i] , dp[i-p]+1)
			p = p*6
	print(dp[n])
if __name__=="__main__":
	main()
# Judge status: Accepted
def comb_mod(n, k, p):
    """
    nCk mod p
    """
    numerator = 1
    denominator = 1
    for i in range(k):
        numerator *= n - i
        numerator %= p
        denominator *= i + 1
        denominator %= p
    return numerator * pow(denominator, p-2, p) % p

mod = 10**9 + 7
n, a, b = map(int, input().split())
result = pow(2, n, mod) - 1

for i in (a, b):
    result -= comb_mod(n, i, mod)
result %= mod

print(result)
# Judge status: Wrong Answer
array = list(map(int, input().split()))
tmp = array[0]
array[0] = abs(array[0] - array[1])
while (tmp >= array[0]):
  tmp = array[0]
  array[0] = abs(array[0] - array[1])
print(tmp)
# Judge status: Accepted
X, A, B = map(int, input().split())

if B <= A:
    print("delicious")
elif B <= (X + A):
    print("safe")
elif B >= (X + A + 1):
    print("dangerous")
# Judge status: Accepted
a=input()

if a==a.upper():
    print("A")
else:
    print("a")
# Judge status: Accepted
import math
A,B,H,M = map(int,input().split())

edge = max(30*H+0.5*M,6*M) - min(30*H+0.5*M,6*M)
C = math.cos(math.radians(edge))
ans = math.sqrt(pow(A,2) + pow(B,2) - 2 * A * B * C)
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

s = input().strip()

target = 'keyence'

if target in s:
    print('YES')
    sys.exit(0)

for start in range(len(s)):
    for end in range(start + 1, len(s) + 1):
        copy_s = list(s)
        copy_s[start:end] = ''
        if ''.join(copy_s) == target:
            print('YES')
            sys.exit(0)
print('NO')
# Judge status: Wrong Answer


import numpy as np

s=[input() for k in range(2)]
for i in range(3):
    if(s[0][i]!=s[1][2-i]):
        print("No")
        exit(0)
print("Yes")
# Judge status: Accepted
N, x = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
for i in range(N-1):
    if arr[i] + arr[i+1] >= x:
        tmp = arr[i] + arr[i+1] - x
        if arr[i+1] >= tmp:
            arr[i+1] -= tmp
        else:
            arr[i+1] = 0
        ans += tmp
print(ans)
# Judge status: Accepted
n=int(input())
A=[]
B=[]
for i in range(n):
    x,y=map(int,input().split())
    A.append(x)
    B.append(y)
A.reverse()
B.reverse()
ans=0

for i in range(n):
    if (A[i]+ans)%B[i]!=0:
        ans+=B[i]-(A[i]+ans)%B[i]
print(ans)
# Judge status: Wrong Answer
# A - Strings

S, T = map(str, input().split())
print(S + T)
# Judge status: Accepted
(n,),a,b=[[*map(int, i.split())]for i in open(0)]
print("YNeos"[sum(j - i if i > j else (j-i)//2 for i, j in zip(a,b))<0::2])
# Judge status: Accepted
n = int(input())

if n/1.08==n//1.08:
    print(n//1.08)
elif int(-(-n//1.08) * 1.08) == n:
    print(int(-(-n//1.08)))
else:
    print(':(')
# Judge status: Wrong Answer
a,b = map(int,input().split())
if (a*b % 2 == 0):
  print("Even")
else:
  print("0dd")
# Judge status: Accepted
N = int(input())
*H, = map(int, input().split())

max = 0
temp = 0

for h_index in range(0, len(H)-1, 1):
    if H[h_index]>=H[h_index+1]:
        temp = temp + 1
        continue
    if max < temp:
        max = temp
    temp = 0
if max < temp:
    max = temp

print(max)
# Judge status: Wrong Answer
from sys import exit
s = input()

ans=""
for i in range(len(s)):
    if s[i] == "0":
        ans = "0" + ans
    elif s[i] == "1":
        ans += "1"
    else:
        if len(ans) != 0 :
            ans = ans[:-1]

print(ans)
# Judge status: Wrong Answer
s=list(input())
res=[]
for i in s:
    if i=="b":
        res=res[:-1]
    else:
        res.append(i)
res="".join(res)
print(res)
# Judge status: Wrong Answer
def main():

    n, m = map(int, input().split())

    import numpy as np
    import scipy.sparse as sp
    ab = [list(map(int, input().split())) for _ in [0]*m]
    g = [[] for _ in [0]*n]
    [g[a-1].append(b-1) for a, b in ab]
    [g[b-1].append(a-1) for a, b in ab]

    data = [1 for a, b in ab]
    row = [a-1 for a, b in ab]
    col = [b-1 for a, b in ab]
    matrix = sp.csr_matrix((data, (row, col)), shape=(n, n), dtype=np.int32)
    d = sp.csgraph.dijkstra(matrix, indices=0)


main()
# Judge status: Accepted
n_sheep ,n_wolves = input().split()
n_sheep , n_wolves = int(n_sheep),int(n_wolves)

if n_sheep > n_wolves:
  print('safe')
else:
  print('unsafe')
# Judge status: Accepted
n, m = map(int, input().split())
connections = [input().split() for _ in range(m)]

for i in range(1, n+1):
    print(sum(c.count(str(i)) for c in connections))
# Judge status: Wrong Answer
n = int(input())
i = 1
j = 1
ans = 0
while i <= n:
  a = list(str(i))
  while j <= i:
    b = list(str(j))
    if a[0] == b[-1] and a[-1] == b[0]:
      ans += 1
    j += 1
  i += 1
print((ans-8)**2 + 8)
# Judge status: Accepted
n = int(input())
W = list(map(int, input().split()))
ans = 1e5
for i in range(n - 1):
  ans = min(ans, abs(sum(W[:i + 1]) - sum(W[i + 1:])))
print(ans)
# Judge status: Accepted
N, M = list(map(int, input().split()))
boxes = [1] * N
boxes_status = [False] * N
boxes_status[0] = True

for i in range(M):
  x, y = list(map(int, input().split()))
  x -= 1
  y -= 1
  if boxes_status[x]:
    if boxes[x] == 1:
      boxes_status[x] = False
    boxes_status[y] = True
  boxes[x] -= 1
  boxes[y] += 1

print(boxes_status.count(True))
# Judge status: Wrong Answer
N=int(input())
S=input()
x=0
for i in S:
  if i=="I":
    x+=1
  elif i=="D":
    x-=1
print(x)
# Judge status: Wrong Answer
n=int(input())
print('Yneos'[(n%9!=0)::2])
# Judge status: Wrong Answer
N = int(input())
import numpy as np
A = [0]*N
B = [0]*N
for i in range(N):
    A[i], B[i] = map(int,input().split())
na = np.median(A)
nb = np.median(B)
if N%2 == 1:
    ans = int(nb - na + 1)
    print(ans)
    exit()
else:
    ans = 2*int(nb - na) + 1
    print(ans)
    exit()
# Judge status: Accepted
n = int(input())
a, b = [input() for i in range(2)]
for i in range(n+1):
  if a[i:] == b[:n-i]:
    print(i + n)
    break
# Judge status: Accepted
n,k,x,y = map(int, open(0))
print(n*x - (x-y)*max(n-k, 0))
# Judge status: Accepted
n = input()
A = list(map(int, input().split()))
ans = 0
while not any (a%2 for a in A):
    ans+=1
    A = [a/2 for a in A]
print(ans)
# Judge status: Accepted
n,l = map(int,input().split())
print(''.join(sorted([input() for i in range(n)])))
# Judge status: Accepted
import sys
input = sys.stdin.readline
A, B = [int(x) for x in input().split()]
import numpy as np
a = np.arange(A, B + 1)
a = np.array(a, np.object)
ans = 0
for i in a:
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        ans += 1
print(ans)
# Judge status: Accepted
from collections import deque
n,m = map(int, input().split())


graph = [[] for _ in range(n+1)]
for i in range (m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

#print(graph)

dist = [-1]*2 + [0 for i in range (n-1)]

d = deque([1])
#print(d)

while d:
    v = d.popleft()
    for i in graph[v]:
        if dist[i] == 0:
            dist[i] = v
            d.append(i)

print("Yes")
ans = dist[2:]
print(*ans, sep="\n")
# Judge status: Wrong Answer
mod=100000007
n,k=list(map(int,input().split(" ")))
sum=0
for i in range(k,n+2):
  sum=sum+i*(n-i+1)+1
print(sum%mod)
# Judge status: Accepted
from scipy import special

S = int(input())
top = S // 3
if top == 0:
    print(0)
    exit()

ans = 1
mod = 10 ** 9 + 7
for i in range(2, top + 1):
    t = S - 3 * i
    i -= 1
    ans += special.comb(t+i, i, True)
print(ans % (mod))
# Judge status: Accepted
n, *a = map(int, open(0).read().split())
cnt = [0] * 100000
for x in a: cnt[x] += 1
ans = 0
for i in range(99998):
    ans = max(ans, cnt[i]+cnt[i+1]+cnt[i+2])
print(ans)
# Judge status: Wrong Answer
h = int(input())
tem = 1
while h/2 > 1:
    tem+=1
    h = h/2
result = 1
print("tem"+str(tem))
for i in range(1,tem+1):
    result += 2**i
print(result)
# Judge status: Accepted
n = int(input())

ans = 10**13
for i in range(1, int(n**0.5//1)+1):
    if n%i == 0:
        ans = min(ans, i+n//i-2)
print(ans)
# Judge status: Accepted
s = int(input())
x1, y1 = 0, 0
x2, y2 = 10**9, 1
x3 = -s % (10**9)
y3 = (s+x3) // (10**9)
print(x1,y1,x2,y2,x3,y3)
# Judge status: Accepted
N,K=map(int,input().split())

a = int(N % K)
b = int(K - a)

print(min(a,b))
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

xmax = max(x)
ymin = min(y)
if (xmax<ymin) and (xmax<Y) and (X<ymin):
  print('No War')
else:
  print('War')
# Judge status: Wrong Answer
n, x, t = map(int, input().split())
a = n/x
if n<x:
  print(0)
if n % x == 0:
  print(a*t)
else:
  print((int(a) + 1)*t)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = list(map(int,input().split()))

if sum(a) >= n:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)

cnt = n-1
i = 0
ans = 0
while cnt:
    if i == 0:
        cnt -= 1
        ans += A[i]
        i += 1
    else:
        if cnt < 2:
            ans += A[i]*cnt
            cnt = 0
        else:
            ans += A[i]*2
            cnt -= 2
            i += 1
print(ans)
# Judge status: Wrong Answer
K = int(input())
N = list(input())
#print(K,N)
ans = []
if len(N) > K:
	for i in range(len(N)-K):
		#print(i,len(N))
		N.pop(-1)
print("".join(N))
# Judge status: Accepted
n,m = map(int,input().split())
a = [list(input()) for _ in range(n)]
b = [list(input()) for _ in range(m)]
r = any([r[j:j+m] for r in a[i:i+m]]==b for i in range(n-m+1) for j in range(n-m+1))
print("Yes" if r == True else "No")
# Judge status: Wrong Answer
D=int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last_day = [0]*26
score = 0

def calc_sum(day,t,sum):
  sum += s[day-1][t-1]
  for j in range(len(c)):
    if(j!=day-1):
      sum -= c[j]*(day-last_day[j])
  return sum

for i in range(D):
  t = 1
  max = 0
  for j in range(26):
    if(max < calc_sum(i+1,j,score)):
      max = calc_sum(i+1,j,score)
      t = j
  last_day[t-1]=i
  score = max
  print(t)
# Judge status: Accepted
kuchi,total=map(int,input().split())

tap=0
while tap*kuchi-(tap-1)<total:
  tap+=1

print(tap)
# Judge status: Accepted
A,B = map(int,input().split())

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 ==0:
	print("Possible")
else:
	print("Impossible")
# Judge status: Accepted
s = input()
S = ""
for i in s:
    if i in "ACGT":S+="1"
    else:S+="0"
print(max(list(map(len,S.split("0")))))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
x = [0]*9
for i in a:
    x[min(i//400,8)]+=1
if x[8]==0:
    print(9-x.count(0),9-x.count(0))
else:
    print(max(1,8-x.count(0)),min(8,8-x.count(0)+x[8]))
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    A, B = map(int, open(0).read().split())

    if (A - B) % 2 == 0:
        if A > B:
            print(A - int(abs(A - B) / 2))
        else:
            print(B - int(abs(A - B) / 2))
    else:
        print('IMPOSSIBLE')


main()
# Judge status: Accepted
n, k = map(int, input().split())
AB = []
for i in range(n):
    a, b = map(int, input().split())
    AB.append((a, b))
AB.sort()
cnt = 0
for a, b in AB:
    cnt += b
    if cnt >= k:
        print(a)
        break
# Judge status: Wrong Answer
N,M = map(int,input().split())
res = {}
for _ in range(M):
    a,b = map(int,input().split())
    if a in res.keys():
        res[a] += 1
    else:
        res[a] = 1
    if b in res.keys():
        res[b] += 1
    else:
        res[b] = 1
for key in sorted(res.keys()):
    print(res[key])
# Judge status: Wrong Answer
h, w = map(int, input().split())

if (h*w) % 2 == 0:
    print(int(h*w/2))
else:
    print(int(h*w//2+1))
# Judge status: Accepted
# map(int, input().split())
N, A, B = map(int, input().split())
mn = A * (N - 1) + B
mx = B * (N - 1) + A
ans = mx - mn + 1
if ans < 0:
    print(0)
else:
    print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
b = [0]*n
for i in range(n):
    sa = a[i] - (i+1)
    b[i] = sa
b.sort()
idx = int(n/2) 

p = b[idx]
ans = 0
for i in range(n):
    ans += abs(i+1+p-a[i])
print(ans)
# Judge status: Accepted
s=input()
s_re=s[::-1]
ans=0
for i in range(len(s)):
    if s[i]!=s_re[i]:
        ans+=1
print(ans//2)
# Judge status: Accepted
N = int(input())
div, mod = divmod(N, 2)

if mod > 0:
    div = div + 1

print(div)
# Judge status: Accepted
# よくよくサンプル1をみたら1ずつインクリメントするので
n, a, b = map(int, input().split())
mins = b + a * (n - 1)
maxs = a + b * (n - 1)
print(max(0, maxs - mins + 1))
# Judge status: Accepted
import math
a,b,c,d = map(int,input().split())

#cで割り切れる数+dで割り切れる数-gcd(c,d)で割り切れる数を求めればよい
ans=(b//c+b//d-b//(c*d//math.gcd(c,d)))-((a-1)//c+(a-1)//d-(a-1)//(c*d//math.gcd(c,d)))

print(b-a+1-ans)
# Judge status: Wrong Answer
import math
n,d=map(int,input().split())
l=[]
ans=0
cnt=0
for i in range(n):
    l.append(list(map(int,input().split())))

for i in range (n-1):
    for k in range(n-i-1):
        for j in range(d):
            ans+=((l[i][j])-(l[i+1+k][j]))**2
        if float.is_integer(math.sqrt(ans))==True:
            cnt+=1
print(cnt)
# Judge status: Accepted
N = int(input())

q = N //2
r = N % 2
print(q + r)
# Judge status: Accepted
N = int(input())

L = [2, 1]

if N == 1:
  print(L[1])
  exit()
else:
  for i in range(2, N+1):
    L.append(L[i-1] + L[i-2])
  print(L[N])
# Judge status: Accepted

n = int(input())
result = int(n ** 0.5)
print(result **2)
# Judge status: Wrong Answer
s="dreamerer"

s=s.replace('eraser','').replace('erase','').replace('dreamer','').replace('dream','')

if len(s)==0:print("YES")
else:print("NO")
# Judge status: Accepted
def resolve():
    n, k = map(int, input().split())
    print(0 if n == 1 or n % k == 0 else 1)


if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
n = int(input())
l = len(str(n))
ans = 0
nl = [int(str(n)[i]) for i in range(l)]

for i in range(l-1):
  if nl[l-1-i] == 10:
    nl[l-2-i] += 1
  elif 10 > nl[l-1-i] > 5:
    ans += 10-nl[l-1-i]
    nl[l-2-i] += 1
  else:
    ans += nl[l-1-i]
if nl[0]==10:
  ans+=1
elif 10>nl[0]>5:
  ans+=11-nl[0]
else:
  ans += nl[0]
print(ans)
# Judge status: Wrong Answer
o = list(input())
e = list(input()) + [""]

print(e)
for x, y in zip(o, e):
    print(x + y, end="")
# Judge status: Accepted
X,N=map(int,input().split())
alist = list(map(int, input().split()))
for a in range(X+1):
    for b in [-1,+1]:
        c = X + a * b
        if alist.count(c) == 0:
            print(c)
            exit(0)
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n>9 and m>9:
  print(-1)
else:
  print(n*m)
# Judge status: Accepted
a = input()
li = []
for s in a:
  li.append(s)

count = 0
for i in range(1,4):
  if li[i] == li[i-1]:
    count += 1
    if count == 2:
      break
  else:
    count = 0

if count >= 2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=sorted(A)
count=0
for i in range(N):
    if A[i]!=B[i]:
        count+=1
if count<=2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a,b,c = map(int,input().split())
if max(a,b,c) * 2 == a + b + c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = []
for _ in range(N):
  Ai,Bi = map(int,input().split())
  A.append([Ai,Bi])
A.sort(key=lambda x: x[0],reverse=True)  
A.sort(key=lambda x: x[1],reverse=True)

sum_pay = 0
checked = [1]*N
j=0
for i in range(N):
  while A[j][0] > M-i or checked[j] == 0:
    j += 1
    if j == N:
      break
  if j == N:
    break     
      
  sum_pay += A[j][1]
  checked[j] = 0

print(sum_pay)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

def res(n, cur, ln, k):
    if ln == n:
        print(cur)
        return
    res(n, cur + chr(ord("a") + k), ln+1, k)
    res(n, cur + chr(ord("a") + k+1), ln + 1, k+1)


def main():
    n = getN()
    res(n, "a", 1, 0)
if __name__ == "__main__":
    main()
# Judge status: Accepted
s=int(input())
mod=10**9+7
ans=0
fac=[1]
for i in range(s*3):
	fac.append(fac[-1]*(i+1)%mod)
def c(x,y):
	r=fac[y]*fac[x-y]%mod
	return fac[x]*pow(r,mod-2,mod)%mod
for i in range(1,s//3+1):
	n=s-3*i
	ans+=c(n+i-1,i-1)
	ans%=mod
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
t=list(map(int,input().split()))
while True:
  tab=0
  for i in t:
    if str(i) in list(str(n)):
      tab+=1
  if tab==0:
    print(n)
    break
  else:
    n+=1
# Judge status: Accepted
n = int(input())

a = [0] * 10010

# x,y,z
for x in range(1, 101):
  for y in range(1, 101):
    for z in range(1, 101):
      if x*x + y*y + z*z + x*y + y*z + z*x > n:
        continue
      a[x*x + y*y + z*z + x*y + y*z + z*x] += 1


for i in range(1, n+1):
  print(a[i])
# Judge status: Accepted
from collections import deque

n=int(input())
a=[0]+list(map(int, input().split()))

b=deque()

for i in range(1, n+1):
    if n%2==i%2:
        b.appendleft(a[i])
    else:
        b.append(a[i])

ans=[]

for elem in b:
    ans.append(elem)

print(*ans)
# Judge status: Wrong Answer
x,y=map(int,input().split())
if (2*x-y)%3!=0 or (x-2*y)%3!=0:
  print(0)
  exit()
a=(2*x-y)//3
b=(2*y-x)//3
mod=10**9+7
def comb(x,y):
    s=1
    t=1
    for i in range(1,y+1):
        s=s*(x-i+1)%mod
        t=t*(i)%mod
    return (s*pow(t,mod-2,mod))%mod
print(comb(a+b,min(a,b)))
# Judge status: Accepted
import math

N = int(input())
A = [math.floor(a/400) if a < 3200 else 3200 for a in list(map(int, input().split()))]

set_A = set([a for a in A if a != 3200])
print(*[max(1, len(set_A)), len(set_A) + A.count(3200)], sep=" ")
# Judge status: Wrong Answer
import math
a,b,h,m=map(int,input().split())
time= 60*h + m
H=time*0.5
M=(time*6) % 360
angle=(abs(H-M))%180
ans=math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(angle)))
print(ans)
# Judge status: Wrong Answer
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab = ab[::-1]

z = 0
cnt = 0
for a, b in ab:
  a += z
  if a <= b:
    z += abs(b-a)
  else:
    if a % b != 0:
      z += b - (a % b)
print(z)
# Judge status: Wrong Answer
N = int(input())
N_List = list(map(int,input().split()))
maxct = 0
ct = 0
for i in range(N-1):
    if N_List[i] >= N_List[i+1]:
        ct += 1
        if (i == N - 2) & (ct > maxct):
            maxct  = ct
    else:
        if maxct < ct:
            maxct = ct
            ct = 0

print(maxct)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
now = 1
for i in range(min(k,int(2*n-1))):
    now = a[now-1]
print(now)
# Judge status: Wrong Answer
a,b = map(int,input().split())
if (a+b) % 3 == 0:
  print('Possible')
else:
  print('Impossible')
# Judge status: Accepted
from collections import Counter
N = int(input())
A = [int(x) for x in input().split()]
pair = []
c = Counter(A)
for x,cnt in c.items():
  pair += [x]*(cnt//2)

pair.sort()

answer = 0
if len(pair)>= 2:
  answer = pair[-1] * pair[-2]

print(answer)
# Judge status: Accepted
x=int(input())
if x>=2000:
    print(1)
else:
    a=x//100
    b=x-100*a
    if a*5>=b:
        print(1)
    else:
        print(0)
# Judge status: Wrong Answer
S = list(input())
if len(S) > 3:
    print(int(S[0]) * int(S[-1]))
else:
    print(-1)
# Judge status: Wrong Answer
import math
N=int(input())
x=math.floor(N/1.08)
X=math.floor((N+1)/1.08)
if x < X:
  print(x)
else:
  print(":(")
# Judge status: Accepted
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()

ans = 0
for i in range(k):
    ans += l[i]

print(ans)
# Judge status: Accepted
n = int(input())
A = [list(map(int,input().split())) for _ in range(2)]

ans = 0
for i in range(n):
  cnt = 0
  for j in range(n):
    if j <= i:
      cnt += A[0][j]
    if j >= i:
      cnt += A[1][j]
  ans = max(ans,cnt)
print(ans)
# Judge status: Wrong Answer
def mycounter(d,i):
    if i in d:
        d[i]+=1
    else:
        d[i]=1
    return d
s=input()
d=dict()
for i in s:
    d=mycounter(d,i)
l=-(-len(s)//3)
for i in d.values():
    if l<i:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
X,Y = list(map(int,input().split()))

flag = False
for i in range(X+1):
    if i*2 + (X-i)*4 == Y:
        flag = True

if flag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())

from math import floor, sqrt
ans = floor(sqrt(N))
print(ans)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_b

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

l = 0
r = n - 1
mid = (l + r) // 2

left = sum(nums[:mid])
right = sum(nums[mid:])
ans1 = abs(left - right)

left = sum(nums[:mid + 1])
right = sum(nums[mid + 1:])
ans2 = abs(left - right)

ans = min(ans1, ans2)
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes' if min(a, b) < c < max(a, b) else 'No')
# Judge status: Accepted
import statistics
import math
n = int(input())
a = list(map(int,input().split()))
ans1,ans2 = 0,0
a_avr1 = math.ceil((statistics.mean(a)))
a_avr2 = math.floor((statistics.mean(a)))
for i in range(n):
  ans1 += (a[i] - a_avr1)**2
  ans2 += (a[i] - a_avr2)**2
print(min(ans1,ans2))
# Judge status: Accepted
A, V = [int(x) for x in input().split()]
B, W = [int(x) for x in input().split()]
T = int(input())

if W >= V:
    print('NO')
elif abs(A - B) <= (V - W) * T:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n, k = map(int, input().split())
s = input()

happy = n
for i in range(n - 1):
    if s[i] + s[i + 1] == "RL":
        happy -= 2
if s[0] == "L":
    happy -= 1
if s[-1] == "R":
    happy -= 1

answer = happy + 2 * k
print(min(answer, n - 1))
# Judge status: Accepted
s = input()
t = input()
ans = "No"
for i in range(len(t)):
  if s == t:
    ans = "Yes"
    break
  else:
    tmp = t[0]
    t = t[1:] + t[0]
    
print(ans)
# Judge status: Accepted
x=int(input())
c=x//500
d=x%500
e=d//5
print(1000*c+e*5)
# Judge status: Wrong Answer
d=int(input())
print("Chrismas"if d==25 else "Chrismas Eve"if d==24 else"Chrismas Eve Eve" if d==23 else"Chrismas EveEveEve")
# Judge status: Wrong Answer
n = int(input())
a = []
b = []

for i in range(n):
  a_temp,b_temp = map(int,input().split())
  a.append(a_temp)
  b.append(b_temp)


ans = 0
for i in range(n):
  ans += (-(a[i] + ans)) % b[i]
print(ans)
# Judge status: Accepted
def resolve():
    n,T=map(int,input().split())
    ans=10000
    for i in range(n):
        c,t=map(int,input().split())
        if t<=T:
            ans=min(ans,c)
    if ans==10000:
        print('TLE')
    else:
        print(ans)
    
if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
x = int(input())

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

while True:
    if is_prime(x):
        print(x)
        exit()
    x+= 1