n = int(eval(input()))

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

a.sort(reverse=True)

N = float("INF")

ans = 0

for i in range(1,n):

    if abs(a[i]-(a[0]-a[i])) < N:

        N = abs(a[i]-(a[0]-a[i]))

        ans = a[i]

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

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

x = max(A)

A.pop(A.index(max(A)))

ans = A[0]

ABS = abs(x//2-A[0])

for a in A[1:]:

    if ABS > abs(x//2-a):

        ans = a

        ABS = abs(x//2-a)

print((x,ans))
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort(reverse=True)
N = float("INF")
ans = 0
for i in range(1, n):
    if abs(a[i] - (a[0] - a[i])) < N:
        N = abs(a[i] - (a[0] - a[i]))
        ans = a[i]
print((a[0], ans))

n = int(eval(input()))
A = list(map(int, input().split()))
x = max(A)
A.pop(A.index(max(A)))
ans = A[0]
ABS = abs(x // 2 - A[0])
for a in A[1:]:
    if ABS > abs(x // 2 - a):
        ans = a
        ABS = abs(x // 2 - a)
print((x, ans))

-a = list(map(int, input().split())) -a.sort(reverse=True) -N = float("INF") -ans = 0 -for i in range(1, n): -    if abs(a[i] - (a[0] - a[i])) < N: -        N = abs(a[i] - (a[0] - a[i])) -        ans = a[i] -print((a[0], ans)) +A = list(map(int, input().split())) +x = max(A) +A.pop(A.index(max(A))) +ans = A[0] +ABS = abs(x // 2 - A[0]) +for a in A[1:]: +    if ABS > abs(x // 2 - a): +        ans = a +        ABS = abs(x // 2 - a) +print((x, ans))