import sys
mapin = lambda: map(int, sys.stdin.readline().split())
listin = lambda: list(map(int, sys.stdin.readline().split()))
inp = lambda: sys.stdin.readline()

N = int(inp())
mp = {}
for i in range(N):
    S = inp()
    S = S[:-1]
    if S in mp:
        mp[S] += 1
    else:
        mp[S] = 1
ans = 0
vec = []
for i in mp.values():
    if ans < i:
        ans = i
for i in mp.keys():
    if mp[i] == ans:
        vec.append(i)
vec.sort()
for i in vec:
    print(i) import sys sys mapin = lambda: map(int, sys.stdin.readline().split()) mapin lambda: map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split listin = lambda: list(map(int, sys.stdin.readline().split())) listin lambda: list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split inp = lambda: sys.stdin.readline() inp lambda: sys.stdin.readline() sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline N = int(inp()) N int(inp()) int inp() inp mp = {} mp {} for i in range(N):
    S = inp()
    S = S[:-1]
    if S in mp:
        mp[S] += 1
    else:
        mp[S] = 1 i range(N) range N S = inp() S inp() inp S = S[:-1] S S[:-1] S :-1 -1 if S in mp:
        mp[S] += 1
    else:
        mp[S] = 1 S in mp S mp mp[S] += 1 mp[S] mp S 1 mp[S] = 1 mp[S] mp S 1 ans = 0 ans 0 vec = [] vec [] for i in mp.values():
    if ans < i:
        ans = i i mp.values() mp.values mp values if ans < i:
        ans = i ans < i ans i ans = i ans i for i in mp.keys():
    if mp[i] == ans:
        vec.append(i) i mp.keys() mp.keys mp keys if mp[i] == ans:
        vec.append(i) mp[i] == ans mp[i] mp i ans vec.append(i) vec.append vec append i vec.sort() vec.sort vec sort for i in vec:
    print(i) i vec print(i) print i vec = [] [] vec inp = lambda: sys.stdin.readline() lambda: sys.stdin.readline() inp ans = 0 0 ans S = inp() inp() S mapin = lambda: map(int, sys.stdin.readline().split()) lambda: map(int, sys.stdin.readline().split()) mapin N = int(inp()) int(inp()) N ans = i i ans mp = {} {} mp listin = lambda: list(map(int, sys.stdin.readline().split())) lambda: list(map(int, sys.stdin.readline().split())) listin S = S[:-1] S[:-1] S
import sys
mapin = lambda: map(int, sys.stdin.readline().split())
listin = lambda: list(map(int, sys.stdin.readline().split()))
inp = lambda: sys.stdin.readline()

N = int(inp())
mp = {}
for i in range(N):
    S = inp()
    S = S[:-1]
    if S in mp:
        mp[S] += 1
    else:
        mp[S] = 1
ans = 0
vec = []
for i in mp.values():
    if ans < i:
        ans = i
for i in mp.keys():
    if mp[i] == ans:
        vec.append(i)
vec.sort()
for i in vec:
    print(i)