Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Your code here!

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(1,sqrt_X + 1):    ##最後は含まないので＋１する必要がある
    for p in range(2,sqrt_X): 　##pは2から始めまる
        now_num = b**p
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!

from math import sqrt
X=int(input())
sqrt_X=int(sqrt(X))
ans=1

for b in range(sqrt_X):
    for p in range(sqrt_X - 1):
        now_num = (b+1)**(p+2)
        if now_num <= X and ans <= now_num:
            ans =now_num
print(ans)
#!/usr/bin/env python2
#encoding: UTF-8

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import math
line=raw_input().rstrip().split(' ')
N=int(line[0])
L=int(line[1])
listo=[]
for i in range(L):
    listo.append(raw_input().rstrip())
listi=sorted(listo)
listni=''
for i in range(L):
    listni+=listi[i]
print listni    

### FIXED CODE ###

#!/usr/bin/env python2
#encoding: UTF-8

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import math
line=raw_input().rstrip().split(' ')
a=int(line[0])
b=int(line[1])
c=int(line[2])
if((a==7 and b==5 and c==5)or(a==5 and b==7 and c==5)or(a==5 and b==5 and c==7)):
    print 'YES'
else:
    print 'NO'
s = list(input())
K = int(input())
character = 'zabcdefghijklmnopqrstuvwxyza'
limit = len(s) - 1

here = 0
while K:
    tmp = character.find(s[here])
    if tmp + K > 26 and here != limit:
        K -= 26 - tmp + 1
        s[here] = 'a'
        here += 1
    elif here == limit:
        K %= 26
        s[here] = character[tmp + K]
        break
    else:
        here += 1
print(''.join(s))

### FIXED CODE ###

s = list(input())
K = int(input())
character = '0abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
limit = len(s) - 1

here = 0
while K:
    tmp = character.find(s[here])
    if tmp == 1 and here != limit:
        here += 1
        continue

    if tmp + K > 26 and here != limit:
        K -= 26 - tmp + 1
        s[here] = 'a'
        here += 1
    elif here == limit:
        K %= 26
        s[-1] = character[tmp + K]
        break
    else:
        here += 1
print(''.join(s))
numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])


def cutting(c, k):
    del c[k::]


x.sort(reverse=True)
cutting(x)
y.sort(reverse=True)
cutting(y)
z.sort(reverse=True)
cutting(z)

answer = []

for i in x:
    for j in y:
        for m in z:
            price = int(i)+int(j)+int(m)
            answer.append(price)

answer.sort(reverse=True)
del answer[k::]

for l in answer:
    print(l)


### FIXED CODE ###

numbers = input().split()
x = input().split()
y = input().split()
z = input().split()

k = int(numbers[3])

answer = []
for i in x:
    for j in y:
        price = int(i)+int(j)
        answer.append(price)
answer.sort(reverse=True)
del answer[k::]
f_ans = []
for m in answer:
    for n in z:
        price = m + int(n)
        f_ans.append(price)

f_ans.sort(reverse=True)
del f_ans[k::]

for l in f_ans:
    print(l)
s=input()
n=len(s)
q=s.count('?')

mod=10**9+7

target='ABC'
ans=0
for i in range(2**3):
    bdp=[1]*(n+1)
    cnt=0
    for j in range(2,-1,-1):
        if (i>>j)&1==1:
            c='?'
            cnt+=1
        else:
            c=target[j]
        
        cdp=[0]*(n+1)
        for k in range(n):
            if s[k]==c:
                cdp[k]=bdp[k+1]
        
        for k in range(n,0,-1):
            cdp[k-1]+=cdp[k]
            cdp[k-1]%=mod
        
        bdp=cdp
    
    ans+=bdp[0]*pow(3,q-cnt,mod)
    ans%=mod

print(ans)

### FIXED CODE ###

s=input()
n=len(s)
q=s.count('?')

mod=10**9+7

target='ABC'
ans=0
for i in range(2**3):
    bdp=[1]*(n+1)
    cnt=0
    for j in range(2,-1,-1):
        if (i>>j)&1==1:
            c='?'
            cnt+=1
        else:
            c=target[j]
        
        cdp=[0]*(n+1)
        for k in range(n):
            if s[k]==c:
                cdp[k]=bdp[k+1]
        
        for k in range(n,0,-1):
            cdp[k-1]+=cdp[k]
            cdp[k-1]%=mod
        
        bdp=cdp
    
    if q>=cnt:
        ans+=bdp[0]*pow(3,q-cnt,mod)
        ans%=mod

print(ans)
X = int(input()))
A = int(input())
B = int(input())

print(X-A-B)

### FIXED CODE ###

X = int(input())
A = int(input())
B = int(input())

n = X - A
res = n - int(n/B)*B

print(res)
a,b=map(in,input().split())
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
from math import pi
r=int(input())
print("{} {}".format(r*r*pi,2*pi*r))

### FIXED CODE ###

from math import pi
r=float(input())
print("{} {}".format(r*r*pi,2*pi*r))
n, m = list(map(int, input().split()))
l = []
r = []
for i in range(m):
    x, y=[int(i) for i in input().split()]
    l.append(x)
    r.append(y)
ans = 0
for i in range(n):
    cnt = 0
    for j in range(m):

        for k in range(l[j], r[j]+1):S
            if i + 1 == k:
                cnt += 1
        if cnt == m:
            ans += 1
print(ans)

### FIXED CODE ###

n, m = list(map(int, input().split()))
maxl = 0
minr = 1000000
for i in range(m):
    l, r = list(map(int, input().split()))
    maxl = max(maxl, l)
    minr = min(minr, r)
if minr < maxl:
    print(0)
else:
    print(minr - maxl + 1)
k = int(input())
g = [[] for _ in range(k)]
for i in range(1,k):
    g[i].append([i*10%k,0])
    if i%10 != 9:
        g[i].append([(i+1)%k,1])
v = [100000]*k
v[1] = 1

def bfs(w,d):
    w_nexts = g[w]
    for w_next in w_nexts:
        if v[w_next[0]] <= d + w_next[1] or d + w_next[1] > 45:
            continue
        v[w_next[0]] = d + w_next[1]
        bfs(w_next[0],d + w_next[1])

bfs(1,1)
print(v[0])


### FIXED CODE ###

k = int(input())
g = [[] for _ in range(k)]
for i in range(1,k):
    g[i].append([i*10%k,0])
    if i%10 != 9:
        g[i].append([(i+1)%k,1])
v = [100000]*k
v[1] = 1

def draw(d):
    for i in range(k):
        if v[i] > d:
            continue
        for v_next in g[i]:
            if v[i] == d and v_next[1] == 0 and v[v_next[0]] > d:
                v_n = v_next[0]
                while v[v_n] > d:
                    v[v_n] = d
                    v_n = v_n*10%k
            elif v[i] == d-1 and v_next[1] == 1 and v[v_next[0]] > d:
                v_n = v_next[0]
                while v[v_n] > d:
                    v[v_n] = d
                    v_n = v_n*10%k
            
for i in range(1,46):
    draw(i)
    if v[0] == i:
        print(v[0])
        exit()
time = [int(input()) for _ in range(5)]

import math
ans = 0
minmod = 10
for i in range(n):
  if time[i]%10!=0:
    minmod = min(minmod,time[i]%10)
  else:
    minmod = min(minmod,10)
  ans += math.ceil(time[i]/10)*10

ans -= (10-minmod)
print(ans)


### FIXED CODE ###

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

for i in range(5):
  if time[i][0]%10!=0:
    time[i].append(time[i][0]%10)
  else:
    time[i].append(10)

time = sorted(time, key = lambda time:time[1])
ans = 0
import math
for i in range(1,5):
  ans = ans + math.ceil(time[i][0]/10)*10
  
ans = ans + time[0][0]
print(ans)
import math
import numpy as np
import itertools

for l, m, n in itertools.product(range(k), range(k), range(k))

k = int(input())
tot = 0

# 二つの数のgcdを計算した結果を入れる配列
g = np.array([[-1] * (k + 1)] * (k + 1), dtype=np.int64)

for l in range(1, k + 1):
    for m in range(1, k + 1):
        for n in range(1, k + 1):
            if g[l][m] == -1:
                g[l][m] = math.gcd(l, m)
            lm_gcd = g[l][m]
            
            if g[lm_gcd][n] == -1:
                g[lm_gcd][n] = math.gcd(lm_gcd, n)
            
            tot += g[lm_gcd][n]
print(tot) 

### FIXED CODE ###

from math import gcd

k = int(input())
tot = 0

for l in range(1, k + 1):
    for m in range(1, k + 1):
        for n in range(1, k + 1):
            tot += gcd(gcd(l, m), n)
print(tot)
N = int(input())
A = []
for i in range(N):
    A.append(list(map(int,input().split())))

output = 0
memo = [0] * N
newmemo = [0] * N
owari = [0] * N
flag = 0
while flag < N:
    ng = 0
    for i in range(N):
        check = A[i][memo[i]]-1
        if i==A[check][memo[check]]-1:
            if memo[i] < N-2:
                newmemo[i]+=1
            elif (memo[i] == N-2) and (owari[i]==0):
                owari[i] = 1
                flag += 1
            else:
                continue
        else:
            ng += 1
    if ng == N:
        output = -1
        break
    memo = newmemo[:]
    output += 1

print(output)

### FIXED CODE ###

N = int(input())
output = int(N*(N-1)//2)
print(output)
N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(W-a[0])if n==1 else max(abs(W-a[-1]),abs(a[-1]-a[-2])))

### FIXED CODE ###

N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(W-a[0])if N==1 else max(abs(W-a[-1]),abs(a[-1]-a[-2])))
n = int(input())

d = {}

for _ in range(n):
    s = str(input())
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))

### FIXED CODE ###

n = int(input())

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

for _ in range(n):
    s = str(input())
    d[s] += 1

print('AC x {}\nWA x {}\nTLE x {}\nRE x {}\n'.format(d['AC'], d['WA'], d['TLE'], d['RE']))
N=int(input())
for i in range(N):
  A=int(input())
  list.append(A)
for j in range(N):
  del list[j]
  print(max(list))
 

### FIXED CODE ###

N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
A_1=l[0]
A_2=l[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(A_2)
N,M = map(int,input().split())
def func(c,x,n):
    c[x][0] = n
    for i in c[x][1:]:
        if c[i][0] == 0:
            func(c,i,n)
    return c
XYZ = list(list(map(int,input().split()))for i in range(M))
card = [[0]for i in range(N)]
set = 0

for x,y,z in XYZ:
    card[x-1].append(y-1)
    card[y-1].append(x-1)
for i in range(N):
    if card[i][0] == 0:
        set += 1
        card = func(card,i,set)
ans = set
for c in card:
    if c == 0:
        ans += 1
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000)
def func(c,x):
    c[x][0] = 1
    for i in c[x][1:]:
        if c[i][0] == 0:
            func(c,i)
    return c

# 入力
N,M = map(int,input().split())
XYZ = list(list(map(int,input().split()))for i in range(M))
############################################
card = [[0]for i in range(N)]
set = 0
############################################
# グラフを描く
for x,y,z in XYZ:
    card[x-1].append(y-1)
    card[y-1].append(x-1)
############################################
for i in range(N):
    if card[i][0] == 0:
        set += 1
        card = func(card,i)
############################################
print(set)
N=int(input())
x=round(N/1.08)+1
if round(x*1.08)=N:
  print(x)
else:
  print(':(')

### FIXED CODE ###

N=int(input())
import math
X=int(N//1.08+1)
if N//1.08==N/1.08:
  print(N/1.08)
else:
  if math.floor(X*1.08)==N:
    print(X)
  else:
    print(':(')
N, M, C = map(int, input().split())
B=list(map(int, input().split))
answer=0
for i in range(N):
  A=list(map(int, input().split))
  for j in range(M):
    sum+=B[j]*A[j]
  if (sum+C)>0:
  answer+=1
print(answer)

### FIXED CODE ###

N,M,C=map(int,input().split())
B=list(map(int,input().split()))
count=0
for i in range(N):
    A=list(map(int,input().split()))
    p=C
    for j in range(M):p+=A[j]*B[j]
    if p>0:count+=1
print(count)
import sys
 
L = [0,1,6,8]
 
def main():
  N = int(input())
  
  if N[-1] == 3:
    print("bon")
  elif N[-1] in L:
    print("pon")
  else:
    print("hon")
 
    
main()

### FIXED CODE ###

import sys
 
def main():
  N = str(input())
  L = [0,1,6,8]
  n_last = int(N[-1])
  if n_last == 3:
    print("bon")
  elif (n_last in L):
    print("pon")
  else:
    print("hon")
 
    
main()
a = map(int, input().split())
print(max(a) - min(a))a = [int(i) for i in input().split()]
print(max(a) - min(a))

### FIXED CODE ###

*a, = map(int, input().split())
print(max(a) - min(a))
n = input()
a = input().split(' ')
a_int = [int(i) for i in asp]

arev_sum = 0
for i in a_int:
    arev_sum += round(1/i, 5)
    
ans = round(1/arev_sum, 5)
print(ans)

### FIXED CODE ###

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

arev_sum = 0
for i in a_int:
    arev_sum += 1/i
    
ans = 1/arev_sum
print(ans)
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a"]
C = input()
for i in range(len(alpha)):
    if C == alpha[i]:
        print(alpha[i+1])

### FIXED CODE ###

alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
C = input()
for i in range(len(alpha)):
    if C == alpha[i]:
        print(alpha[i+1])
x = int(input())
while True:
    if x % 2 != 0:    
        for m in range(3,int(x**0.5)+4,2):
            if x % m == 0 and x < m:
                break
        else:
            break
    x += 1
print (x)

### FIXED CODE ###

s = input().split()
print (s[1]+s[0])
s=input()
ans=0
l=[]
for i in range(len(s)):
    if s[i] not in "ACGT":
        l.append(ans)
        ans=0
    else:
        ans+=1
print(max(l)or 0)

### FIXED CODE ###

s=input()
ans=0
l=[]
for i in range(len(s)):
    #print(s[i],s[i]in"ACGT")
    if s[i] in "ACGT":
        ans+=1
    else:
        l.append(ans)
        ans=0
l.append(ans)
print(max(l))
import math
froat R
R=input()
print(2*math.pi*R)

### FIXED CODE ###

import math
R=float(input())
print(2*R*math.pi)
from collections import Counter

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


ans = 1
C = Counter(prime_factorize(P))
#print(C)
for item in C.items():
    i = item[0]
    v = item[1]
    if v >= N:
        ans *= i**(v//N)
print(ans)

### FIXED CODE ###

N, P = map(int, input().split())

from collections import Counter

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


ans = 1
C = Counter(prime_factorize(P))
#print(C)
for item in C.items():
    i = item[0]
    v = item[1]
    if v >= N:
        ans *= i**(v//N)
print(ans)
import sys

def main():
    N = input()
    ans = 0
    for _ in range(N):
        l, r =  map(int, sys.stdin.readline().rstrip().split())
        ans += abs(r-l) + 1

    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

# vim: set fileencoding=utf-8 :
n = int(raw_input())
kyaku = 0

for _ in range(n):
    l, r = map(int, raw_input().split())
    kyaku += r - l + 1

print(kyaku)
N, H, W = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(N)]
ans = 0

for i in AB:
    if i[0] >= H and AB[1] >= W:
        ans += 1

print(ans)

### FIXED CODE ###

N, H, W = map(int, input().split())
AB = [[int(_) for _ in input().split()] for _ in range(N)]
ans = 0

for i in AB:
    if i[0] >= H and i[1] >= W:
        ans += 1

print(ans)
N = int(input())
L = [False for i in range(100000)]
A = [int(input()) for n in range(N)]


for a in A:
    L[a] = not L[a]

print(sum(L))


### FIXED CODE ###

N = int(input())
A = [int(input()) for n in range(N)]
A = sorted(A)

res = []
tmp = A[0]
count = 1
for i in range(1,N):
    if A[i] == tmp:
        count += 1
    else:
        res.append(count%2 != 0)
        count = 1
    tmp = A[i]
res.append(count%2 != 0)

print(sum(res))
h, n = map(int, input().split())

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

i=0

r=0

while(i<3):
  r+=list[i]
  i+=1

if(h<=r):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

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

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

i=0
r=0

while(i<n):
  r+=list[i]
  i+=1

if(h<=r):
  print("Yes")
else:
  print("No")
# C - Typical Stairs

MOD = 10 ** 9 + 7
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
dp = [None] * (N + 1)

def f(i):
    if dp[i] != None:
        return dp[i]
    else:
        if i in A:
            dp[i] = 0
        elif i < 2:
            dp[i] = 1
        else:
            dp[i] = f(i - 1) + f(i - 2)
        return dp[i] % MOD

print(f(N))


### FIXED CODE ###

# C - Typical Stairs

MOD = (10 ** 9) + 7
N, M = map(int, input().split())
A = [False] * (N + 1)
for _ in range(M):
    A[int(input())] = True
dp = [0] * (N + 1)
dp[0] = 1
if A[1] == False:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i] == True:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])
N = int(input())
A = list(map(int, input().split()))

A_ = A.copy()

ANSWER = []
for i in range(N):
    del A_[i]
    unique_i = list(set(A_))

    answer_i = 0
    for j in unique_i:
        answer_i += (A_.count(j) * (A_.count(j)-1)/2)
    
    ANSWER.append(int(answer_i)
    
    A_ = A.copy()

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
import numpy as np
 
N = int(readline())
A = np.array(read().split(), np.int64)
counter = np.bincount(A)
 
total = (counter * (counter - 1)).sum() // 2
answer = (total - (counter - 1))[A]
 
print('\n'.join(answer.astype(str)))
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse= True)
B.sort(reverse= True)
C.sort(reverse= True)
LIS = []
LISA = []
LISB = []
S = 0
T = 0
for s in range(X):
    for t in range(Y):
        if (s+1)*(t+1) <= 3000:
            LISA.append(s)
            LISB.append(t)
        elif (s+1)*(t+1) > 3000:
            S += s
            T += t
            break
            
for i in range(len(LISA)):
    PR = A[LISA[i]]+B[LISB[i]]
    for j in range(max(Z,(3000//(S+1)),(3000//(T+1)))):
        LIS.append(PR+C[j])
LIS.sort(reverse = True)
for i in range(min(len(LIS),K)):
    print(LIS[i])

### FIXED CODE ###

X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse= True)
B.sort(reverse= True)
C.sort(reverse= True)
LIS = []
for i in range(X):
    INTB = 3000//(i+1)
    for j in range(min(INTB+1,Y)):
        INT = 3000//((i+1)*(j+1))
        for k in range(min(INT+1,Z)):
            SUM = A[i] + B[j] + C[k]
            LIS.append(SUM)
LIS.sort(reverse = True)
for i in range(K):
    print(LIS[i])
x = int(input())

result = x // 11 * 2

if result % 11 == 0:
    print(result)

elif result % 11 < 6:
    print(result + 1)

else:
    print(reault + 2)


### FIXED CODE ###

X=int(input())
d=X//11*2
m=X%11
if m>0:d+=1
if m>6:d+=1
print(d)
M, N = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)　
S = sum(A)
if A[M-1] >=  S / 4M
print('Yes')
else:
    ('No')


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >=  S / (4 * M):
    print('Yes')
else:
    print('No')
a,b = input()
listA = list(map(int,input().split()))
listA.sort()
all = 0

for i in range(b):
  all = all + list[i]

print(all)

### FIXED CODE ###

a,b = map(int,input().split())
listA = list(map(int,input().split()))
listA.sort()
all = 0

for i in range(b):
  all = all + listA[i]

print(all)
import math as m
import functools


def int_reverse(num):
    num_len = len(bin(num))-2
    f = 2**num_len-1
    return num ^ f

n = int(input())
A = [int(input()) for i in range(n)]
lsbs = [[i for i in range(int(m.log2(a))+1) if (a>>i)&1][0] for a in A]
nim = functools.reduce(lambda x,y:x^y, A)

cnt = 0
for lsb in reversed(sorted(lsbs)):
    if int(m.log2(nim)) == lsb:
        nim = int_reverse(nim)
        cnt += 1

ans = cnt if(nim == 0) else -1
print(ans)


### FIXED CODE ###

import math as m
import functools


def int_reverse(num):
    num_len = len(bin(num))-2
    f = 2**num_len-1
    return num ^ f

n = int(input())
A = [int(input()) for i in range(n)]
lsbs = [[i for i in range(int(m.log2(a))+1) if (a>>i)&1][0] for a in A]
nim = functools.reduce(lambda x,y:x^y, A)

cnt = 0
for lsb in reversed(sorted(lsbs)):
    if nim == 0:
        break
    if int(m.log2(nim)) == lsb:
        nim = int_reverse(nim)
        cnt += 1

ans = cnt if(nim == 0) else -1
print(ans)
import math

def combination(n,r):
    return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))

if __name__=="__main__":
    N,K=map(int,input().split())
    a=1000000007
    result=0

    for i in range(1,K+1):
        result=combination(N-K+1,i)*combination(K-1,i-1)
        print(result%a)

### FIXED CODE ###

import math

def combination(n,r):
    return int(math.factorial(n)//(math.factorial(r)*math.factorial(n-r)))

if __name__=="__main__":
    N,K=map(int,input().split())
    a=1000000007
    result=0

    if N==K:
        for i in range(K):
            if i==0:
                print(1)
            else:
                print(0)
    else:
        for i in range(1,K+1):
            if N-K+1-i<0:
                print(0)
            else:
                result=int(combination(N-K+1,i)*combination(K-1,i-1))
                print(result%a)
n = int(input())

if n in 7:
  print("Yes")
elif n not in 7:
  print("No")

### FIXED CODE ###

n = input()
if "7" in n:
  print("Yes")
else:
  print("No")
A,B = map(int,input().split())
S = input()

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
        sys.exit(0)
else:
    print("No")


### FIXED CODE ###

import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")
n = int(input())
res = []
 
for i in range(n):
    x, y = input().split()
    y = int(y)
    res.append((x, y, i))
 
res.sort(key=lambda x: (x[0], -x[1]))
 
for x, y, i in sp:
    print(i+1)

### FIXED CODE ###

n = int(input())
res = []
 
for i in range(n):
    x, y = input().split()
    y = int(y)
    res.append((x, y, i))
 
res.sort(key=lambda x: (x[0], -x[1]))
 
for x, y, i in res:
    print(i+1)
import collections
def resolve_c():
    n = input()
    s_l = [input() for i in range(int(n))]
    c = collections.Counter(s_l)
    for k, v in c.items():
        if v == c.most_common()[0][1]:
            results.append(v)
        else:
            break
    results = sorted(results)
    for r in results:
        print(r)
resolve_c()

### FIXED CODE ###

import collections
def resolve_c():
    n = input()
    s_l = [input() for i in range(int(n))]
    c = collections.Counter(s_l)
    values, counts = zip(*c.most_common())
    results = sorted(list(values[:collections.Counter(counts)[max(counts)]]))
    fin = [print(r) for r in results]
resolve_c()