n = int(input())
a = {}
for i in range(n):
    s = input()
    if s in a:
        a[s] += 1
    else:
        a[s] = 1
a = sorted(a.items(), key=lambda x: x[1], reverse=True)
max_a = a[0][1]
w = []
for i in range(len(a)):
    if a[i][1] == max_a:
        w.append(a[i][0])
    else:
        break
w = sorted(w)
for i in range(len(w)):
    print(w[i]) n = int(input()) n int(input()) int input() input a = {} a {} for i in range(n):
    s = input()
    if s in a:
        a[s] += 1
    else:
        a[s] = 1 i range(n) range n s = input() s input() input if s in a:
        a[s] += 1
    else:
        a[s] = 1 s in a s a a[s] += 1 a[s] a s 1 a[s] = 1 a[s] a s 1 a = sorted(a.items(), key=lambda x: x[1], reverse=True) a sorted(a.items(), key=lambda x: x[1], reverse=True) sorted a.items() a.items a items key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True max_a = a[0][1] max_a a[0][1] [0] a 0 1 w = [] w [] for i in range(len(a)):
    if a[i][1] == max_a:
        w.append(a[i][0])
    else:
        break i range(len(a)) range len(a) len a if a[i][1] == max_a:
        w.append(a[i][0])
    else:
        break a[i][1] == max_a a[i][1] [i] a i 1 max_a w.append(a[i][0]) w.append w append a[i][0] [i] a i 0 break w = sorted(w) w sorted(w) sorted w for i in range(len(w)):
    print(w[i]) i range(len(w)) range len(w) len w print(w[i]) print w[i] w i n = int(input()) int(input()) n max_a = a[0][1] a[0][1] max_a a = {} {} a w = [] [] w w = sorted(w) sorted(w) w a = sorted(a.items(), key=lambda x: x[1], reverse=True) sorted(a.items(), key=lambda x: x[1], reverse=True) a s = input() input() s
n = int(input())
a = {}
for i in range(n):
    s = input()
    if s in a:
        a[s] += 1
    else:
        a[s] = 1
a = sorted(a.items(), key=lambda x: x[1], reverse=True)
max_a = a[0][1]
w = []
for i in range(len(a)):
    if a[i][1] == max_a:
        w.append(a[i][0])
    else:
        break
w = sorted(w)
for i in range(len(w)):
    print(w[i])