Harryxun/stf_run huggingface dataset:
n, d = input().split()
n = int(n)
d = int(d)
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
c = 0

for i in range(n):
  if x[i]*x[i]+y[i]*y[i] <= d*d:
    c +=1

print(c)

### FIXED CODE ###

a = int(input())

if a < 30:
  print('No')
else:
  print('Yes')
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import gcd
def main():
    n, m = map(int, input().split())
    s = list(input())
    t = list(input())

    if s[0] != t[0]:
        print(-1)
        sys.exit()
    if n == m:
        if s == t:
            print(n)
            sys.exit()
        else:
            print(-1)
            sys.exit()
    if n > m:
        l1 = n
        l2 = m
        s1 = s
        s2 = t
    else:
        l1 = m
        l2 = n
        s1 = t
        s2 = s
    if n % m == 0 or m % n == 0:
        ld = l1 // l2
        for i1 in range(1, l2):
            if s2[i1] != s1[i1*ld]:
                print(-1)
                sys.exit()
        print(l1)
        sys.exit()

    l = (n * m) // gcd(n, m)
    x = [0] * l
    ld1 = l // l1
    ld2 = l // l2
    for j1 in range(1, l1):
        x[j1 * ld1] = s1[j1]
    for k1 in range(1, l2):
        if x[k1 * ld2]:
            if x[k1 * ld2] != s2[k1]:
                print(-1)
                sys.exit()
    print(l)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import gcd
def main():
    n, m = map(int, input().split())
    s = tuple(input())
    t = tuple(input())

    if n > m:
        l1 = n
        l2 = m
        s1 = s
        s2 = t
    else:
        l1 = m
        l2 = n
        s1 = t
        s2 = s

    if s[0] != t[0]:
        r = -1
    elif n == m:
        if s == t:
            r = n
        else:
            r = -1
    elif n % m == 0 or m % n == 0:
        ld = l1 // l2
        for i1 in range(1, l2):
            if s2[i1] != s1[i1*ld]:
                r = -1
                break
        else:
            r = l1
    else:
        l = (n * m) // gcd(n, m)
        # x = [0] * l
        ld1 = l // l1
        ld2 = l // l2
        cnt = 1
        r = l
        while cnt < l1:
            cnt2 = cnt * ld1
            if cnt2 % ld2 == 0:
                if s1[cnt] != s2[cnt2 // ld2]:
                    r = -1
                    break
            cnt += 1
    print(r)

if __name__ == '__main__':
    main()
print(input（）.count('1'))



### FIXED CODE ###

print(input().count("1"))
N = int(input())
a = list(map(int, input().split()))
now = ''
ans = 0
for i in range(N):
  if a[i] == now:
    count += 1
  else:
    ans += count//2
    count = 1
    now = a[i]

ans += count//2
print(ans)

### FIXED CODE ###


N = int(input())
a = list(map(int, input().split()))
count = 0
now = 0
ans = 0
for i in range(N):
  if a[i] == now:
    count += 1
  else:
    ans += count//2
    count = 1
    now = a[i]

ans += count//2
print(ans)
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

l = 0
w = len(A[0])
while l <= len(A[0]) - len(B[0]):
	for n in range(len(A) - len(B)):
		if B[0] not in A[n][l:]:
			continue
		if 0 == A[n][l:].index(B[0]):
			for m in range(1, len(B)):
				if 0 != A[n + m][l:].index(B[m]):
					break
				else:
					#print(n, m)
					print("Yes")
					exit()
	l += 1
print("No")


### FIXED CODE ###

N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

l = 0
while l <= len(A[0]) - len(B[0]):
	for i in range(N - M + 1):
		s = A[i][l:]
		if not B[0] in s:
			continue
		if 0 == s.index(B[0]):
			for m in range(1, M):
				if not B[m] in A[i + m][l:]:
					break
				if 0 != A[i + m][l:].index(B[m]):
					break
			else:
				print("Yes")
				exit()
	l += 1
print("No")
N, K = int(input().split())
juice = []
for i in range(N):
    juice.append(list(input().split()))
juice.sort()
print (sum(juice[0:K]))

### FIXED CODE ###

N,K = map(int, input().split())
*a, = map(int, input().split())
print (sum(sorted(a)[:K]))
A, B, Q = map(int, input().split())
S = [int(input()) for i in range(A)]
T = [int(input()) for i in range(B)]
X = [int(input()) for i in range(Q)]

def binary_search(target, N, left, right):
  if right - left <= 1:
    return (left, right)

  mid = (left + right) // 2

  if target == N[mid]:
    return mid

  if target <= N[mid]:
    return binary_search(target, N, left, mid)
  else:
    return binary_search(target, N, mid, right)

s_size = len(S)
t_size = len(T)
inf = 999999999999999999999

for x in X:
  s_left, s_right = binary_search(x, S, 0, s_size)
  t_left, t_right = binary_search(x, T, 0, s_size)

  slv = S[s_left] if s_left < s_size else inf
  srv = S[s_right] if s_right < s_size else inf
  tlv = T[t_left] if t_left < t_size else inf
  trv = T[t_right] if t_right < t_size else inf

  sl = [slv, srv]
  tl = [tlv, trv]
  mini = inf

  for n in [slv, srv]:
    c1 = abs(x - n)
    for m in [tlv, trv]:
      c2 = abs(n-m)
      mini = min(mini, c1+c2)

  for n in [tlv, trv]:
    c1 = abs(x - n)
    for m in [slv, srv]:
      c2 = abs(n-m)
      mini = min(mini, c1+c2)
  print(mini)




### FIXED CODE ###

# TLEするので、自前で用意せずに、ライブラリ使おう
# https://juppy.hatenablog.com/entry/2019/02/24/ABC119_-D_Lazy_Faith-_Python_%E7%AB%B6%E6%8A%80%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0_Atcoder

import bisect
A, B, Q = map(int, input().split())
S = sorted([int(input()) for i in range(A)])
T = sorted([int(input()) for i in range(B)])
X = [int(input()) for i in range(Q)]

s_size = A
t_size = B
inf = 99999999999999

for x in X:
  s_index = bisect.bisect_left(S, x)
  s_left = S[s_index - 1] if s_index > 0 else None
  s_right = S[s_index] if s_index < s_size else None
  t_index = bisect.bisect_left(T, x)
  t_left = T[t_index - 1] if t_index > 0 else None
  t_right = T[t_index] if t_index < t_size else None

  ans = inf

  sl = [s_left, s_right]
  tl = [t_left, t_right]

  for s in sl:
    if not s: continue
    c1 = abs(x - s)
    for t in tl:
      if not t: continue
      ans = min(ans, c1 + abs(s-t))


  for t in tl:
    if not t: continue
    c1 = abs(x - t)
    for s in sl:
      if not s: continue
      ans = min(ans, c1 + abs(s-t))

  print(ans)
def resolve():
    N = int(input())
    list = list(map(int, input().split()))
    no = 0
    non = 0
    ans = 1
    lens = 0
    if (list.count("0") >= 1):
      print("0")
      exit()
    else:
      for i in range(N):
        lens = lens + len(list[non])
        non += 1
        if (lens >= 19):
          print("-1")
          exit()
        else:
          for j in range(N):
            ans = ans * list[no]
            no += 1
            print(ans)
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        exit()
    for i in A:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
resolve()
#coding:utf-8

n,k = map(int,input()split())

if(n < 10):
  k = k + 100 * (10 - n)
  
print("{}".format(k))

### FIXED CODE ###

#coding:utf-8

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

if(n < 10):
  k = k + 100 * (10 - n)
  
print("{}".format(k))
import random
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    is_prime = [True] * (n + 100)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime


a,b = map(int,input().split())


g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

isp = primes(g)
#print(isp)

for e in d:
    if isp[e]:
        res += 1

print(res)



### FIXED CODE ###

import random
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    is_prime = [True] * (n + 100)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime

def is_prime(n):
    if n == 1:
        return True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


a,b = map(int,input().split())

g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

#isp = primes(g)
#print(isp)

for e in d:
    if is_prime(e):
        res += 1

print(res)
def how_many_times_divisible(n):
    	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans

n = int(raw_input())
a = map(int, raw_input().split())
ans = min(map(how_many_times_divisible, a))

print ans


### FIXED CODE ###

print(input().count("1"))
R,C=map(int,input().split())
sx,sy=1,1
gx,gy=R,C
count=0
mp = [[i for i in input().rstrip()] for i in range(R)]
for i in range(R):
  mp[i]=list(mp[i])
for i in range(R):
	for j in range(C):
		if(mp[i][j]=='#'):
			count+=1
ans=[[3000 for i in range(C)] for j in range(R)]
ans[sx-1][sy-1]=0
start=[sx-1,sy-1]
goal=[gx-1,gy-1]
nsx=[1,0,-1,0]
nsy=[0,1,0,-1]

def bfs(graph,st,end):
  queue=[st]
  while queue:
    nw=queue.pop(0)
    if nw==end:
      return ans[end[0]][end[1]]
    else:
      for i in range(4):
        ns1=nw[0]+nsx[i]
        ns2=nw[1]+nsy[i]
        if (0 <= ns1)and(ns1<=(R-1))and(0<=ns2)and(ns2<=(C-1)) and ans[ns1][ns2]==3000 and mp[ns1][ns2]==".":
          ans[ns1][ns2]=ans[nw[0]][nw[1]]+1
          queue.append([ns1,ns2])
  return

print(R*C-bfs(mp,start,goal)-1-count)


### FIXED CODE ###

R,C=map(int,input().split())
sx,sy=1,1
gx,gy=R,C
count=0
mp = [[i for i in input().rstrip()] for i in range(R)]
for i in range(R):
  mp[i]=list(mp[i])
for i in range(R):
	for j in range(C):
		if(mp[i][j]=='#'):
			count+=1
ans=[[3000 for i in range(C)] for j in range(R)]
ans[sx-1][sy-1]=0
start=[sx-1,sy-1]
goal=[gx-1,gy-1]
nsx=[1,0,-1,0]
nsy=[0,1,0,-1]

def bfs(graph,st,end):
  queue=[st]
  while queue:
    nw=queue.pop(0)
    if nw==end:
      return ans[end[0]][end[1]]
    else:
      for i in range(4):
        ns1=nw[0]+nsx[i]
        ns2=nw[1]+nsy[i]
        if (0 <= ns1)and(ns1<=(R-1))and(0<=ns2)and(ns2<=(C-1)) and ans[ns1][ns2]==3000 and mp[ns1][ns2]=='.':
          ans[ns1][ns2]=ans[nw[0]][nw[1]]+1
          queue.append([ns1,ns2])
  return

while True:
	try:
		print(R*C-bfs(mp,start,goal)-1-count)
		break
	except (RuntimeError,TypeError,NameError):
		print(-1)
		break
n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
i,j = 0,0
start = []
while i<n-m:
    if b[0] in a[i]:
        start.append(a[i].index(b[0]))
        j += 1
        for k in range(1,m):
            if b[k] in a[i+j]:
                start.append(a[i+j].index(b[k]))
                j += 1
            else:
                start.clear()
                j = 0
                break
            if (not start[0] == start[j-1]):
                start.clear()
                j = 0
                break
    i += 1
print('Yes' if len(start)>0 else 'No')

### FIXED CODE ###

n, m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
res = True
for i in range(len(b)):
    if b[i] not in a[i]:
        res = False
        break

print('Yes' if res else 'No')
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        if 0<=(s-i-j)<=k:
            ans+=1
print(ans)


### FIXED CODE ###

s = input()
ls = []
for i,j in enumerate(s):
    if i == 5 or i == 13:
        ls.append(" ")
    else:
        ls.append(j)
print("".join(ls))
times = [int(input()) for _ in range(5)]

rem = float("inf")
last = 0
for time in times:
    if time % 10 < rem and time % 10 != 0:
        rem = time % 10
        last = time
times.remove(last)

total_time = 0
for time in times:
    if time % 10 == 0:
        total_time += time
    else:
        total_time += time + (10 - time % 10)
total_time += last

print(total_time)

### FIXED CODE ###

times = [int(input()) for _ in range(5)]

total_time = 0
while times:
    if len(times) != 1:
        for i in range(len(times)):
            if times[i] % 10 == 0:
                total_time += times[i]
                times.remove(times[i])
                break
        else:
            rem = 0
            re_time = 0
            for time in times:
                if time % 10 > rem:
                    rem = time % 10
                    re_time = time
            total_time += re_time + (10 - rem)
            times.remove(re_time)
    else:
        total_time += times.pop()
        
print(total_time)
import collections
a = list(map(str,input().split()))
b = list(map(str,input().split()))
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if Asort.values() == Bsort.values():
  print("Yes")
else:
  print("NO")

### FIXED CODE ###

import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Alist = list(A.values())
Blist = list(B.values())
Asort = sorted(Alist)
Bsort = sorted(Blist)
if Asort == Bsort:
  print("Yes")
else:
  print("No")
import numpy as np
N= int(input())
frag, T, L, Q = np.zeros(N),np.zeros(N),np.zeros(N),[0]
# frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a = 100
frag[0] = 1
def func(ide):
#     print("frag = {}".format(frag))
    for i in E[ide]:
        i = int(i) - 1
        if frag[i] != 1:
            frag[i] = 1
            L[i] = L[ide] +1 
            Q.append(i) 
        else:
            return None
            


E = [input().split()[2:] for _ in range(N)]

while Q:
    top = Q[0]
    func(top)
    del Q[0]
for i in range(N):print(i + 1 ,int(L[i]))


### FIXED CODE ###

N= int(input())
E = [input().split()[2:] for _ in range(N)]
Q = [0]
L = [0] + [-1]*N
frag = [1] + [0]*N
def func(ide):
    global Q
    for i in E[ide]:
        i = int(i) - 1
        if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
        
    

while Q:top = Q[0];func(top);del Q[0]

for i in range(N):print(i + 1 ,int(L[i]))
N, C, K = map(int, input().strip().split(" "))
t = sorted([int(input().strip()) for _ in range(N)])

bus = 0
idx = 0
while idx < N:
    bus_go = t[idx] + K
    tmp = 0
    while idx < N:
        if t[idx] <= bus_go:
            tmp += 1
            idx += 1
            if tmp == C:
                bus += 1
                bus_go = t[idx] + K
                tmp = 0
        else:
            break

    if tmp > 0:
        bus += 1

print(bus)

### FIXED CODE ###

N, C, K = map(int, input().strip().split(" "))
t = sorted([int(input().strip()) for _ in range(N)])

bus = 0
idx = 0
while idx < N:
    bus_go = t[idx] + K
    tmp = 0
    while idx < N:
        if t[idx] <= bus_go:
            tmp += 1
            idx += 1
            if idx == N:
                break
            if tmp == C:
                bus += 1
                tmp = 0
                bus_go = t[idx] + K
        else:
            break
    if tmp > 0:
        bus += 1

print(bus)
A, B = map(int. input().split())

print((A + B) % 24)

### FIXED CODE ###

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

print((A + B) % 24)
N = input()
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, Ns - 2):
	for j in range(i, Ns - 1):
		for k in range(j, Ns):
			if(Ns[i] + Ns[j] > Ns[k] and Ns[j] + Ns[k] > Ns[i] and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)

### FIXED CODE ###


N = int(input())
Ns = list(map(int, input().split()))
Ns.sort()
ans = 0

for i in range(0, N - 2):
	for j in range(i + 1, N - 1):
		for k in range(j + 1, N):
			if(Ns[i] == Ns[j] or Ns[k] == Ns[j]):
				continue

			if(Ns[i] + Ns[j] > Ns[k] and Ns[j] + Ns[k] > Ns[i] and Ns[k] + Ns[i] > Ns[j]):
				ans += 1
print(ans)
n, m, k = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
a_index = 0
b_index = 0
count = 0

def nap(a_index, b_index, time, count):
    if a_index >= len(a_list) and b_index >= len(b_list):
        return count
    else:
        if a_index >= len(a_list) or a_list[a_index]>time:
            nap1 = count
        else:
            nap1 = nap(a_index+1, b_index, time-a_list[a_index], count+1)
        if b_index >= len(b_list) or b_list[b_index]>time:
            nap2 = count
        else:
            nap2 = nap(a_index, b_index+1, time-b_list[b_index], count+1)
    return max(nap1, nap2)

print(nap(0, 0, k, 0))


### FIXED CODE ###

import random
n, m, k = map(int, input().split())
# n, m, k = random.randint(1, 10**5), random.randint(1, 10**5), random.randint(10**8, 10**9)
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
# a_list = [random.randint(1, 10**3) for i in range(n)]
# b_list = [random.randint(1, 10**3) for i in range(m)]
# print(n,m,k)
# print(a_list[0], b_list[0])
a_sum = [0]
b_sum = [0]
max_a = 0
for i in range(1, max(n+1, m+1)):
    if i < n+1:
        a_sum.append(a_sum[i-1] + a_list[i-1])
        if a_sum[i] <= k:
            max_a = i
    if i < m+1:
        b_sum.append(b_sum[i-1] + b_list[i-1])

ans = 0
j = m
for i in range(0, max_a+1):
    while b_sum[j] > k - a_sum[i]:
        j -= 1
    ans = max(ans, i+j)
        
print(ans)
# print(n+m)
M,D = map(int,input().split())
ans =0

if D <22:
  print("0")
  sys.exit()

for i in range(1,M+1):
  for r in range(22,D+1):
    d_tens,d_ones = divmod(r,10)
    
    if d_ones == 0 or d_ones == 1:
      continue
    elif i == d_tens*d_ones:
      ans+=1
    else:
      continue
      
print(ans)


### FIXED CODE ###

M,D = map(int,input().split())
ans = 0

for i in range(1,M+1):
  for j in range(10,D+1):
    a,b = divmod(j,10)
    
    if a>=2 and b>=2:
      if i ==a*b:
        ans += 1
       
      
      
print(ans)
itemgetter

attackCount = 0

N, H = map(int, raw_input().split())
swords = []

for _ in xrange(N):
    swords.append(map(int, raw_input().split()))


swords.sort(key=itemgetter(0), reverse=True)
niceWeapon = swords.pop(0)

subWeapons = [x for x in swords if x[1] > niceWeapon[0]]
subWeapons.sort(key=itemgetter(1), reverse=True)

practicalHP = H
niceWeaponExist = True
if subWeapons and niceWeapon[1] < subWeapons[0][1]:
    practicalHP = H - niceWeapon[1]
    attackCount += 1
    niceWeaponExist = False

if practicalHP <1:
    print attackCount
else:
    while practicalHP > 0 and subWeapons:
        if niceWeaponExist and niceWeapon[1] > subWeapons[0][1]:
            attackCount += 1
            practicalHP -= niceWeapon[1]
            niceWeaponExist = False
        else:
            throwWeapon = subWeapons.pop(0)
            attackCount += 1
            practicalHP -= throwWeapon[1]

    if practicalHP > 0:
        if niceWeaponExist:
            attackCount += 1
            practicalHP -= niceWeapon[1]
            niceWeaponExist = False
    if practicalHP > 0:
        attackCount += (practicalHP / niceWeapon[0])
        if practicalHP % niceWeapon[0]:
            attackCount += 1

    print attackCount


### FIXED CODE ###

from operator import itemgetter

N, H = map(int, raw_input().split())
attackCount = 0

swords = []
for _ in xrange(N):
    swords.append(map(int, raw_input().split()))
swords.sort(key=itemgetter(0), reverse=True)
niceWeapon = swords[0]

subWeapons = [x for x in swords if x[1] > niceWeapon[0]]
subWeapons.sort(key=itemgetter(1), reverse=True)

practicalHP = H

while practicalHP > 0 and subWeapons:
    throwWeapon = subWeapons.pop(0)
    attackCount += 1
    practicalHP -= throwWeapon[1]

if practicalHP > 0:
    attackCount += (practicalHP / niceWeapon[0])
    if practicalHP % niceWeapon[0]:
        attackCount += 1

print attackCount
from statistics import median
n = int(input())
x = list(map(int,input().split()))
i1 = x.index(max(x))
i2 = x.index(min(x))
m1 = median(x[0:i1]+x[i1+1:n])
m2 = median(x[0:i2]+x[i2+1:n])
for i in range(n):
    if m2 == m1:
        print(m1)
    else:
        if x[i]<m2:
            print(m2)
        if x[i]>m1:
            print(m1)

### FIXED CODE ###

import copy
n = int(input())
x = list(map(int,input().split()))
y = copy.copy(x)
y.sort()
m1 = y[n//2-1]
m2 = y[n//2]
for i in range(n):
    if m2 == m1:
        print(m1)
    else:
        if x[i]<m2:
            print(m2)
        if x[i]>m1:
            print(m1)
n = int(input())

def divi(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

import math

num = math.factorial(n)

print(len(divi(num))%1000000007)

### FIXED CODE ###

n = int(input())

def fact(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if n == 1:
    print(1)
    exit()

arr = [0 for _ in range(1001)]

for i in range(1,n+1):

    for j in range(len(fact(i))):
        arr[fact(i)[j][0]] += fact(i)[j][1]

ans = 1
for i in range(2,1001):
    if arr[i] > 0:
        ans *= arr[i] +1
    if ans > 1000000007:
        ans % 1000000007

print(ans % 1000000007)
#include <bits/stdc++.h>
using namespace std;

#define all(v)			((v).begin()), ((v).end())
#define SIZE(v)			((int)((v).size()))
#define LOG(x)			log((double)x)
#define TOLOWER(x)          transform(all(x),x.begin(),::tolower)
#define TOUPPER(x)          transform(all(x),x.begin(),::toupper)
#define ROUND(x,m)			(round((double)x/m)*m)
#define DIGITS(x)			(floor(log10((double)x))+1)
#define READSTR(x)			getline(cin,x)
#define sort_g(a,b)              sort(a, b, greater<int>());
#define IOS() ios_base::sync_with_stdio(0);cin.tie(NULL);
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FILE_INPUT() 	freopen( "input.txt", "r", stdin)
#define FILE_OUTPUT()   freopen( "output.txt", "w", stdout)
#define PI 3.14159265


typedef long long ll;

bool myCmp(pair<int,string> &p1 , pair<int,string>&p2)
{
    if(p1.first == p2.first)
        return p1.second<p2.second;
    else return p1.first > p2.first;
}
unsigned long long
choose(unsigned long long n, unsigned long long k) {
    if (k > n) {
        return 0;
    }
    unsigned long long r = 1;
    for (unsigned long long d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}
int toInt(string str)
{
    int num;
    std::istringstream iss(str); //put string in input stream
    iss >> num; return num; //read from stream as integer
}
ll  OO = 10e9;
const int MAXN = 2*10e5 +1;

map<string,int> m;
vector<pair<int,string>> vsi;
int main() {
    IOS();
    int N;
    cin>>N;
    string s;
    REP(i,N)
    {
        cin>>s;
        m[s]++;
    }
    vsi.resize(m.size());
    int i = 0 ;
    for(auto v : m)
    {
        vsi[i] = make_pair(v.second,v.first);
        ++i;
    }
    sort(vsi.begin(),vsi.end(),myCmp);
    int score = vsi[0].first;
    for(int k = 0; k<vsi.size();++k)
    {
        if(vsi[k].first == score)
            cout<<vsi[k].second<<endl;
        else
            break;
    }
    return 0;
}


### FIXED CODE ###

n = int(input())
dic = {}
for i in range(n):
    s = input()
    try:
        dic[s] += 1
    except:
        dic[s] = 1
high=max(dic.values())
val= sorted(dic.items())
for i in val:
    if(i[1]==high):
        print(i[0])