import sys

input=sys.stdin.readline

n=int(eval(input()))

p=[]

for i in range(n):

	s=input().rstrip()

	p.append(s)

p.sort()

ans=0

cnt=1

for i in range(n-1):

	if p[i]==p[i+1]:

		cnt+=1

	else:

		ans=max(ans,cnt)

		cnt=1

ans=max(ans,cnt)

q=[]

for i in range(n-ans+1):

	if p[i]==p[i+ans-1]:

		q.append(p[i])

q.sort()

for i in range(len(q)):

	print((q[i]))

table={}

import sys

input=sys.stdin.readline

n=int(eval(input()))

ss=[]

for i in range(n):

	s=input().rstrip()

	if s in table:

		table[s]+=1

	else:

		table[s]=1

		ss.append(s)

ans=[]

saidai=max(table.values())

for i in range(len(ss)):

	if table[ss[i]]==saidai:

		ans.append(ss[i])

ans.sort()

for x in ans:

	print(x)
import sys

input = sys.stdin.readline
n = int(eval(input()))
p = []
for i in range(n):
    s = input().rstrip()
    p.append(s)
p.sort()
ans = 0
cnt = 1
for i in range(n - 1):
    if p[i] == p[i + 1]:
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 1
ans = max(ans, cnt)
q = []
for i in range(n - ans + 1):
    if p[i] == p[i + ans - 1]:
        q.append(p[i])
q.sort()
for i in range(len(q)):
    print((q[i]))

table = {}
import sys

input = sys.stdin.readline
n = int(eval(input()))
ss = []
for i in range(n):
    s = input().rstrip()
    if s in table:
        table[s] += 1
    else:
        table[s] = 1
        ss.append(s)
ans = []
saidai = max(table.values())
for i in range(len(ss)):
    if table[ss[i]] == saidai:
        ans.append(ss[i])
ans.sort()
for x in ans:
    print(x)

+table = {} -p = [] +ss = [] -    p.append(s) -p.sort() -ans = 0 -cnt = 1 -for i in range(n - 1): -    if p[i] == p[i + 1]: -        cnt += 1 +    if s in table: +        table[s] += 1 -        ans = max(ans, cnt) -        cnt = 1 -ans = max(ans, cnt) -q = [] -for i in range(n - ans + 1): -    if p[i] == p[i + ans - 1]: -        q.append(p[i]) -q.sort() -for i in range(len(q)): -    print((q[i])) +        table[s] = 1 +        ss.append(s) +ans = [] +saidai = max(table.values()) +for i in range(len(ss)): +    if table[ss[i]] == saidai: +        ans.append(ss[i]) +ans.sort() +for x in ans: +    print(x)