# import itertools
# import math
# import sys
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
# Q = list(map(int, input().split()))
# S = input()

d = {}
for i in range(N):
    S = input()
    d.setdefault(S, 0)
    d[S] += 1

cnt_max = max(d.values())
d = sorted(d.items(), key=lambda x:x[0]) # keyでsort

for k, v in d:
    if cnt_max == v:
        print(k) N = int(input()) N int(input()) int input() input d = {} d {} for i in range(N):
    S = input()
    d.setdefault(S, 0)
    d[S] += 1 i range(N) range N S = input() S input() input d.setdefault(S, 0) d.setdefault d setdefault S 0 d[S] += 1 d[S] d S 1 cnt_max = max(d.values()) cnt_max max(d.values()) max d.values() d.values d values d = sorted(d.items(), key=lambda x:x[0]) d sorted(d.items(), key=lambda x:x[0]) sorted d.items() d.items d items key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x for k, v in d:
    if cnt_max == v:
        print(k) k v d if cnt_max == v:
        print(k) cnt_max == v cnt_max v print(k) print k d = {} {} d S = input() input() S d = sorted(d.items(), key=lambda x:x[0]) sorted(d.items(), key=lambda x:x[0]) d N = int(input()) int(input()) N cnt_max = max(d.values()) max(d.values()) cnt_max
# import itertools
# import math
# import sys
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
# Q = list(map(int, input().split()))
# S = input()

d = {}
for i in range(N):
    S = input()
    d.setdefault(S, 0)
    d[S] += 1

cnt_max = max(d.values())
d = sorted(d.items(), key=lambda x:x[0]) # keyでsort

for k, v in d:
    if cnt_max == v:
        print(k)