n=int(eval(input()))

 

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

t.sort()

a1 = max(t)

 

ans = 100000000000000

 

memo = 0



for i in t:

    if ans > abs(a1/2-i):

        ans = abs(a1/2-i)

        memo = i

print((a1, memo))

n=int(eval(input()))



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



t.sort()



max_value = t[-1]



mid_value = 0



for a in t:

    if abs(max_value/2-a) < abs(max_value/2-mid_value):

        mid_value = a



print((max_value, mid_value))
n = int(eval(input()))
t = list(map(int, input().split()))
t.sort()
a1 = max(t)
ans = 100000000000000
memo = 0
for i in t:
    if ans > abs(a1 / 2 - i):
        ans = abs(a1 / 2 - i)
        memo = i
print((a1, memo))

n = int(eval(input()))
t = list(map(int, input().split()))
t.sort()
max_value = t[-1]
mid_value = 0
for a in t:
    if abs(max_value / 2 - a) < abs(max_value / 2 - mid_value):
        mid_value = a
print((max_value, mid_value))

-a1 = max(t) -ans = 100000000000000 -memo = 0 -for i in t: -    if ans > abs(a1 / 2 - i): -        ans = abs(a1 / 2 - i) -        memo = i -print((a1, memo)) +max_value = t[-1] +mid_value = 0 +for a in t: +    if abs(max_value / 2 - a) < abs(max_value / 2 - mid_value): +        mid_value = a +print((max_value, mid_value))