N = int(eval(input()))

d = {}

max = 0

ans = []



for _ in range(N):

    key = eval(input())

    if not(key in d):

        d[key] = 1

        if max<d[key]:

            max = d[key]

    else:

        d[key] += 1

        if max<d[key]:

            max = d[key]



for key in d:

    if d[key]==max:

        ans.append(key)



ans.sort()



for i in range(len(ans)):

    print((ans[i]))
N = int(eval(input()))



d = {}



max = 0



for _ in range(N):

    S = eval(input())

    if S in d:

        d[S] = d[S] + 1

        if max < d[S]:

            max = d[S]

        continue

    d[S] = 1

    if max < d[S]:

        max = d[S]



ans = []



for key in d:

    if d[key]==max:

        ans.append(key)



ans.sort()

for a in ans:

    print(a)
N = int(eval(input()))
d = {}
max = 0
ans = []
for _ in range(N):
    key = eval(input())
    if not (key in d):
        d[key] = 1
        if max < d[key]:
            max = d[key]
    else:
        d[key] += 1
        if max < d[key]:
            max = d[key]
for key in d:
    if d[key] == max:
        ans.append(key)
ans.sort()
for i in range(len(ans)):
    print((ans[i]))

N = int(eval(input()))
d = {}
max = 0
for _ in range(N):
    S = eval(input())
    if S in d:
        d[S] = d[S] + 1
        if max < d[S]:
            max = d[S]
        continue
    d[S] = 1
    if max < d[S]:
        max = d[S]
ans = []
for key in d:
    if d[key] == max:
        ans.append(key)
ans.sort()
for a in ans:
    print(a)

+for _ in range(N): +    S = eval(input()) +    if S in d: +        d[S] = d[S] + 1 +        if max < d[S]: +            max = d[S] +        continue +    d[S] = 1 +    if max < d[S]: +        max = d[S] -for _ in range(N): -    key = eval(input()) -    if not (key in d): -        d[key] = 1 -        if max < d[key]: -            max = d[key] -    else: -        d[key] += 1 -        if max < d[key]: -            max = d[key] -for i in range(len(ans)): -    print((ans[i])) +for a in ans: +    print(a)