Harryxun/stf_run huggingface dataset:
import collections

n = int(input())
s = [input() for i in range(n)]

counter = collections.Counter(s)
most = counter.most_common()
ans = []
for i in range(n):
    if most[i][1] == most[0][1]:
        ans.append(most[i][0])
    else:
        break
ans.sort()
for i in ans:
    print(i)

### FIXED CODE ###

import collections
 
n = int(input())
s = [input() for i in range(n)]
 
counter = collections.Counter(s)
most = counter.most_common()
ans = []
for i in range(len(counter.keys())):
    if most[i][1] == most[0][1]:
        ans.append(most[i][0])
    else:
        break
ans.sort()
for i in ans:
    print(i)
N、K = map(int,input().split())
H = list(map(int,input().split()))
count = 0

for i in range(N):
  if H[i] >= K:
    count += 1
    
print(count)

### FIXED CODE ###

N,K = map(int,input().split())
H = list(map(int,input().split()))
count = 0
for i in range(N):
  if H[i] >= K:
    count += 1
print(count)
n,l=map(int,input().split())
s=0
list=[]
for i in range(1,n+1):
  s+=i
  list.append(abs(l+i-1)
sum=n*(l-i)+s
if l-1<-n:
  print(sum+min(list))
else:
  print(sum-min(list))

### FIXED CODE ###

n,l=map(int,input().split())
s=0
list=[]
for i in range(1,n+1):
  s+=i
  list.append(abs(l+i-1))
sum=n*(l-1)+s
m=list.index(min(list))
print(sum-l-m)
import numpy as np
import sys
L,R = map(int,input().split())
a = np.zeros(R-L+1,dtype="int64")
b = 2019
if R - L >= 2018:
  print("0")
  sys.exit()
else:
  for i in range (L,R+1):
    for j in range (L+1,R+1):
      x = (i * j) % 2019
      b = min(b,x)
  print(b)

### FIXED CODE ###

L, R = map(int,input().split())
b = 2018
if R - L >= 2019:
  print(0)
else:
  L = L % 2019
  R = R % 2019
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      if b > (i * j) % 2019:
        b = (i * j) % 2019
  print(b)
s,t = map(input().split())

print(t+s)

### FIXED CODE ###

s,t = input().split()

print(t+s)
N = int(input())
res = []
for i in range(N):
    S, P = list(input().split())
    bisect.insort(res, (S, -int(P), i + 1))
for i in range(len(res)):
    print(res[i][2])

### FIXED CODE ###

import sys
from collections import deque, defaultdict
import copy
import bisect
#input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)


N = int(input())
res = []
for i in range(N):
    S, P = list(input().split())
    bisect.insort(res, (S, -int(P), i + 1))
for i in range(len(res)):
    print(res[i][2])
n = int(input)
p = list(map(int, input().split()))

v = sorted(p)
cou=0
for i in range(n):
    if not p[i] == v[i]:
        cou+=1

if cou <= 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
 
q = sorted(p)
cou = 0
for i in range(n):
    if p[i] != q[i]:
        cou += 1
 
if cou <= 2:
    print("YES")
else:
    print("NO")
def main():
    N = str(input())
    N = N[-3]
    N = int(N)
    N = 10 - N
    if N == 10:
        print(0)
    else:
        print(N*100)
main()

### FIXED CODE ###

def main():
    N = int(input())
    if N < 1000:
        print(1000 - N)
        return
    N = str(N)
    N = N[-3] + N[-2] + N[-1]
    N = int(N)
    if N == 0:
        print(0)
        return
    
    print(1000 - N)
    
main()
r = int(input())
if r < 1200:
  print("ABC")
else r < 2800:
  print("ARC")
else:
  print("AGC")

### FIXED CODE ###

r = int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")
N = input()
Y = input()
x = y = z = 0
z = N
while(1):
    if 10000*x+5000*y+1000*z == Y:
        print x,y,z
        break
    else:
        if z > 0:
            y += 1
            z -= 1
        elif y > 0:
            x += 1
            y = 0
            z =	N - x
        else:
            print -1, -1, -1
            break


### FIXED CODE ###

S = raw_input('')
a = '2018/01/'
b = S[8:]
print a+b
n,k,s = map(int,input().split())
a=0
b=0

list=[]

for i in range(k):
    list.append(s)

if len(list) < n:
    for i in range(n-len(list)):
        list.append(s-1)

for i in list:
    print(i,end=" ")

### FIXED CODE ###

h = int(input())
w = int(input())
n = int(input())

a = 0
ans = 0

if h < w:
    a = w
else:
    a = h

ans = n // a
# int(ans)
if n % a > 0:
    ans += 1

print(ans)
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

in_day = input();

if in_day == day[x]:
  print(7 - x)
  
  

### FIXED CODE ###

S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(7 - days.index(S))
import sys

s = int(input())

i = 0
a = []
a.append(s)
b = [0] * 300

while True:
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(a[i] * 3 + 1)
    b[a[i]] += 1
    i += 1
    for j in range(300):
        if b[j] == 2:
            print(i)
            sys.exit()


### FIXED CODE ###

s = int(input())

i = 0
a = []
a.append(s)
b = [0] * 10000

while True:
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(a[i] * 3 + 1)
    b[a[i]] += 1
    if b[a[i]] == 2:
        break
    i += 1

print(i + 1)
def findTrailingZeros(n): 
      
    # If n is odd 
    if (n & 1): 
        return 0
  
    # If n is even 
    else: 
        ans = 0
  
        # Find the trailing zeros 
        # in n/2 factorial 
        n //= 2
        while (n): 
            ans += n // 5
            n //= 5
  
        # Return the required answer 
        return ans 
  
# Driver code 
  
n=input();
  
print(findTrailingZeros(n)) 
  

### FIXED CODE ###

def fun(n):
    if n%2!=0:
        return 0
    else:
        ans=0
        n//=2
        while(n):
            ans=ans+n//5
            n=n//5
    return ans


n = int(input())
if n>=2:
    print(fun(n))
else:
    print(0)
N = int(input())
x = list(map(int, input().split()))
 
n = len(x)

sum_a = 0
sum_b = 0

for xi in x:
  sum_a += xi * xi
  sum_b += xi
  
ans = sum_a - (sum_b*sum_b)/n
min_ans = 10**9
if ans < min_ans
    ans = min_ans

print(int(ans+0.5))

### FIXED CODE ###

N = int(input())
x = list(map(int, input().split()))
 
n = len(x)
 
sum_a = 0
sum_b = 0
 
for xi in x:
  sum_a += (xi*xi)
  sum_b += xi

p = int(sum_b/n+0.5)
ans = sum_a - 2*sum_b*p+n*p*p

min_ans = 10**9
if ans > min_ans:
    ans = min_ans
print(int(ans))
n=str(input())
s=0
for i in range(1,n+1):
    if i%3!=0 or i%3!=0:
        s+=i
print(s)

### FIXED CODE ###

n=int(input())
s=0
for i in range(1,n+1):
    if i%3!=0 and i%5!=0:
        s+=i
print(s)
import sys
import math

input = sys.stdin.readline
 
def main():
  a,b = map(double, input().split())
  print(math.floor(a * b))

if __name__ == '__main__':
  main()

### FIXED CODE ###

from decimal import Decimal, ROUND_FLOOR
 
a,b = input().split()
a = int(a)
b = Decimal(b)
 
print(int(a*b))
def bfs(k):
    p=k
    level={1:1}
    frontier=[1]
    while frontier:
        next=[]
        for u in frontier:
            if u==1:
                l=k-1
            else:
                l=k-2
            i=0
            for v in adj[u]:
                if v not in level:
                    level[v]=1
                    p=(p*(l-i))%(10**9+7)
                    i+=1
                    next.append(v)
        frontier=next
    return p
n,k=map(int,input().split())
adj={}
for i in range(n-1):
    a,b=map(int,input().split())
    if a not in adj:
        adj[a]=[b]
    else:
        adj[a].append(b)
    if b not in adj:
        adj[b]=[a]
    else:
        adj[b].append(a)
print(bfs(k))

### FIXED CODE ###

def bfs(k):
    p=k
    level={1:1}
    frontier=[1]
    while frontier:
        next=[]
        for u in frontier:
            if u==1:
                l=k-1
            else:
                l=k-2
            i=0
            for v in adj[u]:
                if v not in level:
                    level[v]=1
                    p=(p*(l-i))%(10**9+7)
                    i+=1
                    next.append(v)
        frontier=next
    return p
n,k=map(int,input().split())
adj={}
for i in range(n-1):
    a,b=map(int,input().split())
    if a not in adj:
        adj[a]=[b]
    else:
        adj[a].append(b)
    if b not in adj:
        adj[b]=[a]
    else:
        adj[b].append(a)
if n==1:
  print(k)
else:
  print(bfs(k))
N,H = list(map(int, input().split()))
A=0
B=[]
for _ in range(N):
    a,b = list(map(int, input().split()))
    A = max(A, a)
    B.append(b)

B.sort(reverse=True)
from itertools import accumulate
B = list(accumulate(B))
HP_after_throw = H - B[-1]
if HP_after_throw <= 0:
    for i,b in enumerate(B,1):
        if H<b:
            print(i)
            exit()
    raise AssertionError('error')
else:
    q,r = divmod(HP_after_throw, A)
    print(N+q+min(1, r))


### FIXED CODE ###

N,H = list(map(int, input().split()))
A=0
B=[]
for _ in range(N):
    a,b = list(map(int, input().split()))
    A = max(A, a)
    B.append(b)

B = sorted([b for b in B if b>A], reverse=True)
from itertools import accumulate
B = list(accumulate(B))
total_throw_damage = (B[-1] if len(B)>0 else 0)

HP_after_throw = H - total_throw_damage
if HP_after_throw <= 0:
    for i,b in enumerate(B,1):
        if H<=b:
            print(i)
            exit()
    raise AssertionError('error')
else:
    q,r = divmod(HP_after_throw, A)
    print(len(B)+q+min(1, r))
a,b,c=[int(input()) for _ i in range(3)]
print(int(a+b)*h/2)

### FIXED CODE ###

a, b, h = [int(input()) for _ in range(3)]
print((a+b)*h//2)
a = input()
b = input()
flag = True
if (a=='H' and b=='H'):
    flag = True
if (a=='H' and b=='D'): 
    flag = False
if (a=='D' and b=='H'): 
    flag = False
if (a=='D' and b=='d'): 
    flag = True
print('H' if flag else 'D')

### FIXED CODE ###

l = input().split()
a = l[0]
b = l[1]
flag = True
if (a=='H' and b=='H'):
    flag = True
if (a=='H' and b=='D'): 
    flag = False
if (a=='D' and b=='H'): 
    flag = False
if (a=='D' and b=='d'): 
    flag = True
print('H' if flag else 'D')
N,M,C=map(int,input().split())
B=list(int,input().split())
num=0
for i in range(N):
  sum=0
  A=list(int,input().split())
  for j in range(M):
    sum+=A[j] * B[j]
  if sum+C >0:
    num+=1
print(num)

### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
num=0
A=[]
for i in range(N):
  A.append(list(map(int,input().split())))
D=[]
for j in range(N):
  sum=0
  D=A[j]
  for k in range(M):
    sum+=B[k]*D[k]
  if sum+C>0:
    num+=1
print(num)
N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7

def gcd(x,y):
    if x<y:x,y=y,x
    if y==0:return x
    return gcd(y,x%y)
S = [A[1]//gcd(A[0],A[1]),A[0]//gcd(A[0],A[1])]
for i in range(2,N):
    a = A[i-1]*S[i-1]
    b = A[i]*a//gcd(A[i],a)
    c = b//a
    S = list(map(lambda x:x*c,S))
    S.append(b//A[i])
print(sum(S)%mod)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7
def gcd(x,y):
    if x<y:x,y=y,x
    if y==0:return x
    return gcd(y,x%y)
a = 1
for i in range(N):
    a = a*A[i]//gcd(a,A[i])
ans = 0
for i in range(N):
    ans+= a//A[i]
print(ans%mod)
#coding:UTF-8
num = int(input())
max=0
for i in range(1,num+1):
  count=0
  work=i
  while work%2==0:
    work=work//2
    count = count+1
#    print("i:{} count:{} max:{}".format(i,count,max))
  if max<count:
    max=count
    ans=i
print(ans)

### FIXED CODE ###

#coding:UTF-8
num = int(input())
max=0
for i in range(1,num+1):
  count=0
  work=i
  while work%2==0:
    work=work//2
    count = count+1
#    print("i:{} count:{} max:{}".format(i,count,max))
  if max<count:
    max=count
    ans=i
if(max==0):
  print(1)
else:
  print(ans)
from itertools import permutations
"""
どの順番に出てくるかをすべて（6通り）ためす
そこからa,b,cのずれ幅の組み合わせ（2000**2）をためす
判定をO(1)ですると
2000*2*6 = 2.4*10**7
x: aとbのずれ幅
y: aとcのずれ幅
"""
def main():
    ss = sorted([input() for _ in range(3)])
    n = len(max(ss, key=len))
    d = [[[None]*3 for _ in range(3)] for _ in range(n)]
    ans = n*3
    for s in permutations(ss):
        for i in range(3):
            for j in range(i, 3):
                for k in range(len(s[i])):
                    ok = True
                    for ni in range(k, len(s[i])):
                        nj = ni - k
                        if nj > len(s[j]):
                            break
                        if s[i][ni] == "?" or s[j][nj] == "?":
                            continue
                        if s[i][ni] != s[j][nj]:
                            ok = False
                    d[i][j][k] = ok
        f = lambda i, j, k: True if k>=len(s[i]) else d[i][j][k]
        for x in range(n):
            for y in range(n):
                if not f(0, 1, x):
                    continue
                if not f(1, 2, y):
                    continue
                if not f(0, 2, x+y):
                    continue
                now = max([0, len(s[0]), x+len(s[1]), x+y+len(s[2])])
                ans = min(ans, now)
    print(ans)
                
if __name__ == "__main__":
    main()

### FIXED CODE ###

from itertools import permutations
"""
どの順番に出てくるかをすべて（6通り）ためす
そこからa,b,cのずれ幅の組み合わせ（2000**2）をためす
判定をO(1)ですると
2000*2*6 = 2.4*10**7
x: aとbのずれ幅
y: aとcのずれ幅
"""
def main():
    ss = sorted([input() for _ in range(3)])
    n = len(max(ss, key=len))
    d = [[[None]*n for _ in range(3)] for _ in range(3)]
    ans = n*3
    for s in permutations(ss):
        for i in range(3):
            li = len(s[i])
            for j in range(i, 3):
                lj = len(s[j])
                for k in range(li):
                    ok = True
                    for ni in range(k, li):
                        nj = ni - k
                        if nj >= lj:
                            break
                        if s[i][ni] == "?" or s[j][nj] == "?":
                            continue
                        if s[i][ni] != s[j][nj]:
                            ok = False
                    d[i][j][k] = ok
        f = lambda i, j, k: True if k>=len(s[i]) else d[i][j][k]
        for x in range(n):
            for y in range(n):
                if not f(0, 1, x):
                    continue
                if not f(1, 2, y):
                    continue
                if not f(0, 2, x+y):
                    continue
                now = max([0, len(s[0]), x+len(s[1]), x+y+len(s[2])])
                ans = min(ans, now)
    print(ans)
                
if __name__ == "__main__":
    main()
N=int(input())
A=[int(x)for x in input().split()]
B=[]
if N%2==0:
    for i in range((N//2)):
        B.append(2*i+1)
        B.append(2*i+1)
    if sorted(A)==sorted(B):
        ans0=pow(2,(N/2))
        
        ans=ans0%(10**9+7)
    else:
        ans=0
else:
    B.append(0)
    for i in range(1,((N-1)//2)+1):
        B.append(2*i)
        B.append(2*i)
    if sorted(A)==sorted(B):
        ans0=pow(2,(N-1)/2)
        ans=ans0%(10**9+7)
    else:
        ans=0
print(ans)
 

### FIXED CODE ###

mod = 10**9 + 7
n = int(input())
a = sorted(list(map(int,input().split())))
 
if n % 2 == 0:
  for i in range(n//2):
    if not a[2*i] == a[2*i+1] == 2*i+1:
      print(0)
      exit()
else:
  if a[0] != 0:
    print(0)
    exit()
  for i in range(n//2):
    if not a[2*i+1] == a[2*i+2] == 2*i+2:
      print(0)
      exit()
print(pow(2, n//2) % mod)
X = int(input())

l = [0,1,2,3,4,5]
a = X // 100
b = X % 100

if ((b // a) in l) and ((b % a) in l):
    print('1')
else:
    print('0')

### FIXED CODE ###

X = int(input())

l = [1,2,3,4,5]
a = X // 100
b = X % 100

ans = 0
for i in l:
    if b % i == 0:
        if b // i <= a:
            ans = 1
            break

print(ans)
a,b,k =  input().split()
a = int(a)
b = int(b)
k = int(k)
if a <= k:
    i = 0
    m = b - (k-a)
else:
    i = a-k
    m=b
print(i,m)
    

    

### FIXED CODE ###

a,b= input().split()
c = b + a
print(c)
a, b, c = [ list(input()) for i in range(h) ]
print(b+min(c,a+b))

### FIXED CODE ###

a, b, c = [ int(v) for v in input().split() ]
print(b+min(c,a+b+1))
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = []
for i in range(N):
	tmp = []
	n = INT()
	shougen = []
	for j in range(n):
		shougen = MAP()
		tmp.append(shougen)
	A.append(tmp)

cand = []
for i in range(2**N):
	shojiki = [0]*N
	for j in range(N):
		if (i>>j & 1):
			shojiki[N-j-1]=1
	cand.append(shojiki)
# print(cand)

ans = []
for c in cand:
	list = [-1]*(N+1)
	success = True
	for idx,a in enumerate(A):
		# idxの人が正直者であると仮定
		if c[idx] == 1:
			for aa in a:
				if list[aa[0]] == -1:
					list[aa[0]] = aa[1]
				else:
					if list[aa[0]]!=aa[1]:
						success=False
		# そうでなければ、その人の発言は無視
		else:
			for aa in a:
				list[aa[0]] = 0 if aa[1] == 1 else 1
	for k in range(len(c)):
		if c[k]==1 and list[k+1]==0:
			success = False
		if c[k]==0 and list[k+1]==1:
			success = False
	if success:
		#print(c, list)
		ans.append(sum(c))
	
#print(ans)
print(max(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
A = []
for i in range(N):
	tmp = []
	n = INT()
	shougen = []
	for j in range(n):
		shougen = MAP()
		tmp.append(shougen)
	A.append(tmp)

cand = []
for i in range(2**N):
	shojiki = [0]*N
	for j in range(N):
		if (i>>j & 1):
			shojiki[N-j-1]=1
	cand.append(shojiki)
# print(cand)

ans = []
for c in cand:
	list = [-1]*(N+1)
	success = True
	ones = [a for idx,a in enumerate(A) if c[idx]==1]
	for idx,a in enumerate(ones):
		for aa in a:
			if list[aa[0]] == -1:
				list[aa[0]] = aa[1]
			else:
				if list[aa[0]]!=aa[1]:
					success=False
	for k in range(len(c)):
		if c[k]==1 and list[k+1]==0:
			success = False
		if c[k]==0 and list[k+1]==1:
			success = False
	if success:
		#print(c, list)
		ans.append(sum(c))
	
#print(ans)
if ans:
	print(max(ans))
else:
	print(0)
print((T//A)*B)

### FIXED CODE ###

A, B, T = map(int, input().split())
print(int( (T+0.5)/A)*B)
#coding: utf-8
N = int(input())
S = input()
ans = 1
for i in range(1, N-1):
    if S[i-1] != S[i]:
        ans += 1
if S[-2] != S[-1]:
    ans += 1
print(ans)

### FIXED CODE ###

# coding: utf-8
N = int(input())
S = input()
ans = 1
for i in range(1, N):
    if S[i-1] != S[i]:
        ans += 1
print(ans)
# distutils: language=c++
# cython: language_level=3
# cython: boundscheck=False
# cython: wraparound=False
# cython: infer_types=True
# cython: cdivision=True
# False:Cython はCの型に対する除算・剰余演算子に関する仕様を、(被演算子間の符号が異なる場合の振る舞いが異なる)Pythonのintの仕様に合わせ、除算する数が0の場合にZeroDivisionErrorを送出します。この処理を行わせると、速度に 35% ぐらいのペナルティが生じます。 True:チェックを行いません。



# define 
ctypedef long long LL

# 読み込みはpython側で行う
import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.readline #文字列読み込む時はこっち

cdef LL a_int(): return int(readline())

cdef LL i,j,k,_


cdef LL A=a_int()
cdef LL B=a_int()
cdef LL C=a_int()
cdef LL X=a_int()

# 愚直にシミュレーション
cdef LL a,b,c,ans
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            ans += (500*a + 100*b + 50*c == X)
print(ans)


### FIXED CODE ###

mycode = r'''
# distutils: language=c++
# cython: language_level=3
# cython: boundscheck=False
# cython: wraparound=False
# cython: infer_types=True
# cython: cdivision=True
# False:Cython はCの型に対する除算・剰余演算子に関する仕様を、(被演算子間の符号が異なる場合の振る舞いが異なる)Pythonのintの仕様に合わせ、除算する数が0の場合にZeroDivisionErrorを送出します。この処理を行わせると、速度に 35% ぐらいのペナルティが生じます。 True:チェックを行いません。



# define 
ctypedef long long LL

# 読み込みはpython側で行う
import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.readline #文字列読み込む時はこっち

cdef LL a_int(): return int(readline())

cdef LL i,j,k,_


cdef LL A=a_int()
cdef LL B=a_int()
cdef LL C=a_int()
cdef LL X=a_int()

# 愚直にシミュレーション
cdef LL a,b,c,ans
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            ans += (500*a + 100*b + 50*c == X)
print(ans)

'''

import sys
if sys.argv[-1] == 'ONLINE_JUDGE':  # コンパイル時
    import os
    with open('mycode.pyx', 'w') as f:
        f.write(mycode)
    os.system('cythonize -i -3 -b mycode.pyx')

import mycode
for t in range(int(input())):
	a,b,c,d=map(int,input().split(' '));l,x,y,o=(a+b)//(min(a,b)+1),(a*l-b)//(l-1),(b*l-a)//(l-1),""
	if a*l<=b:x,y=0,a+b
	elif b*l<=a:x,y=a+b,0
	for i in range(c,d+1):o+="AB"[i%(l+1)==0] if i<=x else "BA"[(a+b-i+1)%(l+1)==0] if a+b-i+1<=y else "AB"[a-x+x//(l+1)-y//(l+1)==0]
	print(o)

### FIXED CODE ###

T=int(input())
for TT in range(T):
	a,b,c,d=map(int,input().split(' '))
	l,x,y=(a+b)//(min(a,b)+1),0,0
	if a*l<=b:
		y=a+b
	elif b*l<=a:
		x=a+b
	else:
		x,y=(a*l-b)//(l-1),(b*l-a)//(l-1)
	out=""
	for i in range(c,d+1):
		if i<=x:
			out+="AB"[i%(l+1)==0]
		elif a+b-i+1<=y:
			out+="BA"[(a+b-i+1)%(l+1)==0]
		else:
			out+="AB"[a-x+x//(l+1)-y//(l+1)==0]
	print(out)
#coding: utf-8

N = str(input())
sum = 0

for i in range(len(S)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

#coding: utf-8

N = str(input())
sum = 0

for i in range(len(N)):
    sum += int(N[i])

if(int(N)%sum==0):
    print('Yes')
else:
    print('No')
import math
import numpy as np

def gcd_mul(numbers):
    s = math.gcd(numbers[0], numbers[1])
    for i in range(2, len(numbers)) :
        s = math.gcd(s, numbers[i])
    return(s)

N = int(input())
A = np.array(list(map(int, input().split())))

ans = 0
for i in range(N) :
    B = A[np.arange(len(A))!=i]
    g = gcd_mul(B)
    if g > ans :
        ans = g
print(ans)





### FIXED CODE ###

import fractions # for python 3.4.3

N = int(input())
A = list(map(int, input().split()))

gcd_l = [0]
gcd_r = [0]
for i in range(N):
    gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
    gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    #print(gcd_l)
    #print(gcd_r)
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

print(max(ans))
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
for i in range(n):
  a=arr[i]
  for j in range(i+1,n):
    b=arr[j]
    tmp=a+b
    pos=bisect.bisect_left(arr,tmp)-1
    if pos<=j:
      continue
    else:
      ans+=(pos-j)
print(ans)

### FIXED CODE ###

import bisect

n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
for i in range(n):
  a=arr[i]
  for j in range(i+1,n):
    b=arr[j]
    tmp=a+b
    pos=bisect.bisect_left(arr,tmp)-1
    if pos<=j:
      continue
    else:
      ans+=(pos-j)
print(ans)
from itertools import accumulate
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
acc = list(accumulate(a))

def maxsum(ls,k):
  l = len(ls)
  if l==0:
    return 0
  dp = [0 for i in range(l+1)]
  dp[0] = 1
  for i in range(1,l+1):
    dp[i] = (dp[i-1]|(dp[i-1]<<ls[i-1]))&(1<<k)
  for b in range(k-1,-1,-1):
    if dp[l] & 1<<b:
      return b

for i in range(n):
  if a[i]>=k:
    a = a[:i]
    break
n = len(a)
if acc[n-1] < k:
  print(n)
  exit()
sepa=[]
for i in range(n-1):
  if acc[i]<a[i+1]:
    sepa.append(i)
m=len(sepa)
if m==0:
  print(0)
  exit()
lf = 0
r = m-1
while lf<r:
  mid = (lf+r)//2
  x=sepa[mid]
  sumx = acc[x]
  if maxsum(a[x+1:],k)+sumx >= k:
    r = mid
  else:
    lf = mid+1
if r==0:
  t=sepa[0]
  if maxsum(a[t+1:],k)+acc[t]>=k:
    print(0)
  else:
    print(sepa[r]+1)
else:
  print(sepa[r]+1)

### FIXED CODE ###

from itertools import accumulate
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
acc = list(accumulate(a))

def maxsum(ls,k):
  l = len(ls)
  if l==0:
    return 0
  dp = [0 for i in range(l+1)]
  dp[0] = 1
  for i in range(1,l+1):
    dp[i] = (dp[i-1]|(dp[i-1]<<ls[i-1]))&((1<<k)-1)
  for b in range(k-1,-1,-1):
    if dp[l] & 1<<b:
      return b

for i in range(n):
  if a[i]>=k:
    a = a[:i]
    break
n = len(a)
if acc[n-1] < k:
  print(n)
  exit()
sepa=[]
for i in range(n-1):
  if acc[i]<a[i+1]:
    sepa.append(i)
m=len(sepa)
if m==0:
  print(0)
  exit()
lf = 0
r = m-1
while lf<r:
  mid = (lf+r)//2
  x=sepa[mid]
  sumx = acc[x]
  if maxsum(a[x+1:],k)+sumx >= k:
    r = mid
  else:
    lf = mid+1
if r==0:
  t=sepa[0]
  if maxsum(a[t+1:],k)+acc[t]>=k:
    print(0)
  else:
    print(sepa[r]+1)
else:
  print(sepa[r]+1)