n = int(eval(input()))



s = {}

for i in range(n):

  a = eval(input())

  if a in s:

    s[a] += 1

  else:

    s[a] = 1



max = max(s.values())

s = sorted(s.items())

for i in s:

  if i[1] == max:

    print((i[0]))

n = int(eval(input()))



a = {}

b = []

for i in range(n):

  s = eval(input())

  b.append(s)

  if s in a:

    a[s] += 1

  else:

    a[s] = 1



b = sorted(list(set(b)))

p = max(a.values())



for i in b:

  if a[i] == p:

    print(i)
n = int(eval(input()))
s = {}
for i in range(n):
    a = eval(input())
    if a in s:
        s[a] += 1
    else:
        s[a] = 1
max = max(s.values())
s = sorted(s.items())
for i in s:
    if i[1] == max:
        print((i[0]))

n = int(eval(input()))
a = {}
b = []
for i in range(n):
    s = eval(input())
    b.append(s)
    if s in a:
        a[s] += 1
    else:
        a[s] = 1
b = sorted(list(set(b)))
p = max(a.values())
for i in b:
    if a[i] == p:
        print(i)

-s = {} +a = {} +b = [] -    a = eval(input()) -    if a in s: -        s[a] += 1 +    s = eval(input()) +    b.append(s) +    if s in a: +        a[s] += 1 -        s[a] = 1 -max = max(s.values()) -s = sorted(s.items()) -for i in s: -    if i[1] == max: -        print((i[0])) +        a[s] = 1 +b = sorted(list(set(b))) +p = max(a.values()) +for i in b: +    if a[i] == p: +        print(i)