count = {}
for i in range(int(input())):
    S = input()
    if S in count:
        count[S] += 1
    else:
        count[S] = 1
ans = max(count.values())
print(*sorted([A[0] for A in count.items() if A[1] == ans])) count = {} count {} for i in range(int(input())):
    S = input()
    if S in count:
        count[S] += 1
    else:
        count[S] = 1 i range(int(input())) range int(input()) int input() input S = input() S input() input if S in count:
        count[S] += 1
    else:
        count[S] = 1 S in count S count count[S] += 1 count[S] count S 1 count[S] = 1 count[S] count S 1 ans = max(count.values()) ans max(count.values()) max count.values() count.values count values A[0] for A in count.items() if A[1] == ans for A in count.items() if A[1] == ans A count.items() count.items count items A[1] == ans A[1] A 1 ans if A[1] == ans A[0] A 0 print(*sorted([A[0] for A in count.items() if A[1] == ans])) print *sorted([A[0] for A in count.items() if A[1] == ans]) sorted([A[0] for A in count.items() if A[1] == ans]) sorted [A[0] for A in count.items() if A[1] == ans] count = {} {} count ans = max(count.values()) max(count.values()) ans S = input() input() S
count = {}
for i in range(int(input())):
    S = input()
    if S in count:
        count[S] += 1
    else:
        count[S] = 1
ans = max(count.values())
print(*sorted([A[0] for A in count.items() if A[1] == ans]))