N = int(input())
import collections
a = []

for i in range(N):
    S = input()
    a.append(S)

l = collections.Counter(a)

x = max(l.values())

ans = [k for k, v in l.items() if v == x]
ans = sorted(ans)


for i in ans:
    print(i)



 N = int(input()) N int(input()) int input() input import collections collections a = [] a [] for i in range(N):
    S = input()
    a.append(S) i range(N) range N S = input() S input() input a.append(S) a.append a append S l = collections.Counter(a) l collections.Counter(a) collections.Counter collections Counter a x = max(l.values()) x max(l.values()) max l.values() l.values l values k for k, v in l.items() if v == x for k, v in l.items() if v == x k v l.items() l.items l items v == x v x if v == x k ans = [k for k, v in l.items() if v == x] ans [k for k, v in l.items() if v == x] ans = sorted(ans) ans sorted(ans) sorted ans for i in ans:
    print(i) i ans print(i) print i l = collections.Counter(a) collections.Counter(a) l ans = sorted(ans) sorted(ans) ans a = [] [] a x = max(l.values()) max(l.values()) x ans = [k for k, v in l.items() if v == x] [k for k, v in l.items() if v == x] ans N = int(input()) int(input()) N S = input() input() S
N = int(input())
import collections
a = []

for i in range(N):
    S = input()
    a.append(S)

l = collections.Counter(a)

x = max(l.values())

ans = [k for k, v in l.items() if v == x]
ans = sorted(ans)


for i in ans:
    print(i)




