n = int(eval(input()))

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

a.sort()

M = max(a)

m = M/2

tmp = 1e9

for i in range(n-1):

    if tmp > abs(a[i]-m):

        tmp = abs(a[i]-m)

        ans = i



print((M,a[ans]))
n = int(eval(input()))

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



m = max(a)

res = 1e10

ans = 0

for i in a:

    if i != m:

        if abs(m//2-i) < res:

            res = abs(m//2-i)

            ans = i



print((m,ans))
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
M = max(a)
m = M / 2
tmp = 1e9
for i in range(n - 1):
    if tmp > abs(a[i] - m):
        tmp = abs(a[i] - m)
        ans = i
print((M, a[ans]))

n = int(eval(input()))
a = list(map(int, input().split()))
m = max(a)
res = 1e10
ans = 0
for i in a:
    if i != m:
        if abs(m // 2 - i) < res:
            res = abs(m // 2 - i)
            ans = i
print((m, ans))

-a.sort() -M = max(a) -m = M / 2 -tmp = 1e9 -for i in range(n - 1): -    if tmp > abs(a[i] - m): -        tmp = abs(a[i] - m) -        ans = i -print((M, a[ans])) +m = max(a) +res = 1e10 +ans = 0 +for i in a: +    if i != m: +        if abs(m // 2 - i) < res: +            res = abs(m // 2 - i) +            ans = i +print((m, ans))