import sys

input = sys.stdin.readline
N = int(input())
d = {}
for _ in range(N):
    s = input().replace('\n', '')
    d[s] = d.get(s, 0) + 1
max_count = 0
for count in d.values():
    max_count = max(max_count, count)

ans = sorted([k for k, v in d.items() if v == max_count])
print('\n'.join(ans)) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N = int(input()) N int(input()) int input() input d = {} d {} for _ in range(N):
    s = input().replace('\n', '')
    d[s] = d.get(s, 0) + 1 _ range(N) range N s = input().replace('\n', '') s input().replace('\n', '') ().replace () input replace '\n' '' d[s] = d.get(s, 0) + 1 d[s] d s d.get(s, 0) + 1 d.get(s, 0) d.get d get s 0 1 max_count = 0 max_count 0 for count in d.values():
    max_count = max(max_count, count) count d.values() d.values d values max_count = max(max_count, count) max_count max(max_count, count) max max_count count k for k, v in d.items() if v == max_count for k, v in d.items() if v == max_count k v d.items() d.items d items v == max_count v max_count if v == max_count k ans = sorted([k for k, v in d.items() if v == max_count]) ans sorted([k for k, v in d.items() if v == max_count]) sorted [k for k, v in d.items() if v == max_count] print('\n'.join(ans)) print '\n'.join(ans) '\n'.join '\n' join ans d = {} {} d N = int(input()) int(input()) N input = sys.stdin.readline sys.stdin.readline input ans = sorted([k for k, v in d.items() if v == max_count]) sorted([k for k, v in d.items() if v == max_count]) ans max_count = max(max_count, count) max(max_count, count) max_count s = input().replace('\n', '') input().replace('\n', '') s max_count = 0 0 max_count
import sys

input = sys.stdin.readline
N = int(input())
d = {}
for _ in range(N):
    s = input().replace('\n', '')
    d[s] = d.get(s, 0) + 1
max_count = 0
for count in d.values():
    max_count = max(max_count, count)

ans = sorted([k for k, v in d.items() if v == max_count])
print('\n'.join(ans))
