n, m = map(int, input().split())
arr = list(map(int, input().split()))
d = {}
for a in arr:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
dd = [[k, v] for k, v in d.items()]
dd = sorted(dd, key=lambda x: x[1])
if dd[-1][1] > n // 2:
    print(dd[-1][0])
else:
    print("?")

bbe96af1c091b5bd9a30ce7b7fd8bbfd709fa6b4
<mask token>

<mask token>
for a in arr:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
<mask token>
if dd[-1][1] > n // 2:
    print(dd[-1][0])
else:
    print('?')

n, m = map(int, input().split())
arr = list(map(int, input().split()))
d = {}
for a in arr:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
dd = [[k, v] for k, v in d.items()]
dd = sorted(dd, key=lambda x: x[1])
if dd[-1][1] > n // 2:
    print(dd[-1][0])
else:
    print('?')

n, m = map(int, input().split())
arr = list(map(int, input().split()))
d = {}
for a in arr:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
dd = [[k, v] for k, v in d.items()]
dd = sorted(dd, key=lambda x: x[1])
if dd[-1][1] > n // 2:
    print(dd[-1][0])
else:
    print("?")
