from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
d = []
s = set()
dd = {}
ind = 0
for i in range(n):
    x = input()
    if x in s:
        d[dd[x]][1] += 1
    else:
        dd[x] = ind
        d.append([x,1])
        ind += 1
        s.add(x)
d.sort(key = lambda x:x[1], reverse = True)
# print(d)
res = []
for key,va in d:
    if va < d[0][1]:
        break
    res.append(key)
res.sort()
for x in res:
    print(x) from collections import Counter,defaultdict,deque from heapq import heappop,heappush from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys math itertools fractions pprint 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 INF = float('inf') INF float('inf') float 'inf' def inp(): return int(sys.stdin.readline()) inp def inpl(): return list(map(int, sys.stdin.readline().split())) inpl n = inp() n inp() inp d = [] d [] s = set() s set() set dd = {} dd {} ind = 0 ind 0 for i in range(n):
    x = input()
    if x in s:
        d[dd[x]][1] += 1
    else:
        dd[x] = ind
        d.append([x,1])
        ind += 1
        s.add(x) i range(n) range n x = input() x input() input if x in s:
        d[dd[x]][1] += 1
    else:
        dd[x] = ind
        d.append([x,1])
        ind += 1
        s.add(x) x in s x s d[dd[x]][1] += 1 d[dd[x]][1] [dd[x]] d dd[x] dd x 1 1 dd[x] = ind dd[x] dd x ind d.append([x,1]) d.append d append [x,1] x 1 ind += 1 ind 1 s.add(x) s.add s add x d.sort(key = lambda x:x[1], reverse = True) d.sort d sort key = lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse = True reverse True res = [] res [] for key,va in d:
    if va < d[0][1]:
        break
    res.append(key) key va d if va < d[0][1]:
        break
     va < d[0][1] va d[0][1] [0] d 0 1 break res.append(key) res.append res append key res.sort() res.sort res sort for x in res:
    print(x) x res print(x) print x INF = float('inf') float('inf') INF def inpl(): return list(map(int, sys.stdin.readline().split())) def inpl(): return list(map(int, sys.stdin.readline().split())) inpl d = [] [] d ind += 1 1 ind s = set() set() s ind = 0 0 ind dd = {} {} dd x = input() input() x def inp(): return int(sys.stdin.readline()) def inp(): return int(sys.stdin.readline()) inp n = inp() inp() n res = [] [] res mod = 10**9+7 10**9+7 mod
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
d = []
s = set()
dd = {}
ind = 0
for i in range(n):
    x = input()
    if x in s:
        d[dd[x]][1] += 1
    else:
        dd[x] = ind
        d.append([x,1])
        ind += 1
        s.add(x)
d.sort(key = lambda x:x[1], reverse = True)
# print(d)
res = []
for key,va in d:
    if va < d[0][1]:
        break
    res.append(key)
res.sort()
for x in res:
    print(x)