n = int(eval(input()))

a_list = list(map(int, input().split()))



ai = max(a_list)

a_list.remove(ai)

sorted([a - (ai / 2) for a in a_list])[0]



tmp = ai

cand = ai

for x in [a - (ai / 2) for a in a_list]:

    if abs(x) < tmp:

        tmp = abs(x)

        cand = int(x + (ai / 2))



print((ai, cand))
n = int(eval(input()))

a_list = list(map(int, input().split()))



ai = max(a_list)

a_list.remove(ai)

aj = int(sorted([a - (ai / 2) for a in a_list], key=abs)[0] + (ai / 2))



print((ai, aj))
n = int(eval(input()))
a_list = list(map(int, input().split()))
ai = max(a_list)
a_list.remove(ai)
sorted([a - (ai / 2) for a in a_list])[0]
tmp = ai
cand = ai
for x in [a - (ai / 2) for a in a_list]:
    if abs(x) < tmp:
        tmp = abs(x)
        cand = int(x + (ai / 2))
print((ai, cand))

n = int(eval(input()))
a_list = list(map(int, input().split()))
ai = max(a_list)
a_list.remove(ai)
aj = int(sorted([a - (ai / 2) for a in a_list], key=abs)[0] + (ai / 2))
print((ai, aj))

-sorted([a - (ai / 2) for a in a_list])[0] -tmp = ai -cand = ai -for x in [a - (ai / 2) for a in a_list]: -    if abs(x) < tmp: -        tmp = abs(x) -        cand = int(x + (ai / 2)) -print((ai, cand)) +aj = int(sorted([a - (ai / 2) for a in a_list], key=abs)[0] + (ai / 2)) +print((ai, aj))