import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
s = sorted(inplL(n))

tmp = ''
ans = []
anscnt = -1
for i in range(n):
    if tmp == s[i]:
        ans[anscnt][1] += 1
    else:
        ans.append([s[i],1])
        anscnt += 1
    tmp = s[i]

ans.sort(key=lambda x: x[1],reverse=True)

tmp = 0
ret = []
for i in range(len(ans)):
    if i == 0 or tmp == ans[i][1]:
        ret.append(''.join(ans[i][0]))
        tmp = ans[i][1]
    elif tmp != ans[i][1] :
        break

ret.sort()
for i in range(len(ret)):
    print(ret[i]) import sys, bisect, math, itertools, string, queue, copy sys bisect math itertools string queue copy import numpy as np numpy import scipy scipy from collections import Counter,defaultdict,deque from itertools import permutations, combinations from heapq import heappop, heappush from fractions import gcd sys.setrecursionlimit(10**8) sys.setrecursionlimit sys setrecursionlimit 10**8 10 8 mod = 10**9+7 mod 10**9+7 10**9 10 9 7 def inp(): return int(input()) inp def inpm(): return map(int,input().split()) inpm def inpl(): return list(map(int, input().split())) inpl def inpls(): return list(input().split()) inpls def inplm(n): return list(int(input()) for _ in range(n)) inplm n n list(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(input()) list input() input def inplL(n): return [list(input()) for _ in range(n)] inplL n n tuple(input()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) tuple(input()) tuple input() input def inplT(n): return [tuple(input()) for _ in range(n)] inplT n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def inpll(n): return [list(map(int, input().split())) for _ in range(n)] inpll n n list(map(int, input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) inplls n n n = inp() n inp() inp s = sorted(inplL(n)) s sorted(inplL(n)) sorted inplL(n) inplL n tmp = '' tmp '' ans = [] ans [] anscnt = -1 anscnt -1 for i in range(n):
    if tmp == s[i]:
        ans[anscnt][1] += 1
    else:
        ans.append([s[i],1])
        anscnt += 1
    tmp = s[i] i range(n) range n if tmp == s[i]:
        ans[anscnt][1] += 1
    else:
        ans.append([s[i],1])
        anscnt += 1
     tmp == s[i] tmp s[i] s i ans[anscnt][1] += 1 ans[anscnt][1] [anscnt] ans anscnt 1 1 ans.append([s[i],1]) ans.append ans append [s[i],1] s[i] s i 1 anscnt += 1 anscnt 1 tmp = s[i] tmp s[i] s i ans.sort(key=lambda x: x[1],reverse=True) ans.sort ans sort key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True tmp = 0 tmp 0 ret = [] ret [] for i in range(len(ans)):
    if i == 0 or tmp == ans[i][1]:
        ret.append(''.join(ans[i][0]))
        tmp = ans[i][1]
    elif tmp != ans[i][1] :
        break i range(len(ans)) range len(ans) len ans if i == 0 or tmp == ans[i][1]:
        ret.append(''.join(ans[i][0]))
        tmp = ans[i][1]
    elif tmp != ans[i][1] :
        break i == 0 or tmp == ans[i][1] i == 0 i 0 tmp == ans[i][1] tmp ans[i][1] [i] ans i 1 ret.append(''.join(ans[i][0])) ret.append ret append ''.join(ans[i][0]) ''.join '' join ans[i][0] [i] ans i 0 tmp = ans[i][1] tmp ans[i][1] [i] ans i 1 elif tmp != ans[i][1] :
        break tmp != ans[i][1] tmp ans[i][1] [i] ans i 1 break ret.sort() ret.sort ret sort for i in range(len(ret)):
    print(ret[i]) i range(len(ret)) range len(ret) len ret print(ret[i]) print ret[i] ret i def inpl(): return list(map(int, input().split())) def inpl(): return list(map(int, input().split())) inpl tmp = '' '' tmp def inpls(): return list(input().split()) def inpls(): return list(input().split()) inpls anscnt = -1 -1 anscnt def inplL(n): return [list(input()) for _ in range(n)] def inplL(n): return [list(input()) for _ in range(n)] inplL def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)]) inplls tmp = s[i] s[i] tmp mod = 10**9+7 10**9+7 mod ans = [] [] ans def inp(): return int(input()) def inp(): return int(input()) inp def inpll(n): return [list(map(int, input().split())) for _ in range(n)] def inpll(n): return [list(map(int, input().split())) for _ in range(n)] inpll n = inp() inp() n s = sorted(inplL(n)) sorted(inplL(n)) s def inpm(): return map(int,input().split()) def inpm(): return map(int,input().split()) inpm anscnt += 1 1 anscnt ret = [] [] ret tmp = 0 0 tmp def inplm(n): return list(int(input()) for _ in range(n)) def inplm(n): return list(int(input()) for _ in range(n)) inplm tmp = ans[i][1] ans[i][1] tmp def inplT(n): return [tuple(input()) for _ in range(n)] def inplT(n): return [tuple(input()) for _ in range(n)] inplT
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
s = sorted(inplL(n))

tmp = ''
ans = []
anscnt = -1
for i in range(n):
    if tmp == s[i]:
        ans[anscnt][1] += 1
    else:
        ans.append([s[i],1])
        anscnt += 1
    tmp = s[i]

ans.sort(key=lambda x: x[1],reverse=True)

tmp = 0
ret = []
for i in range(len(ans)):
    if i == 0 or tmp == ans[i][1]:
        ret.append(''.join(ans[i][0]))
        tmp = ans[i][1]
    elif tmp != ans[i][1] :
        break

ret.sort()
for i in range(len(ret)):
    print(ret[i])