N = int(eval(input()))

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

n = A[-1]

k = A[0]

for i in range(1,N-1):

    j = A[i]

    if k<=n//2 and j<=n//2:

        k = max(k,j)

    elif k<=n//2 and j>n//2:

        if k<n-j:

            k = j

    elif k>n//2 and j<=n//2:

        if n-k<j:

            k = j

    elif k>n//2 and j>n//2:

        if n-k<n-j:

            k = j

print((n,k))
n = int(eval(input()))

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

for i in range(n):

    if A[i]*2>A[-1]:

        ind = i

        break

ind -= 1

a = A[ind]

b = A[-1]-A[ind+1]

if a>=b:

    print((A[-1],a))

else:

    print((A[-1],A[ind+1]))

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
n = A[-1]
k = A[0]
for i in range(1, N - 1):
    j = A[i]
    if k <= n // 2 and j <= n // 2:
        k = max(k, j)
    elif k <= n // 2 and j > n // 2:
        if k < n - j:
            k = j
    elif k > n // 2 and j <= n // 2:
        if n - k < j:
            k = j
    elif k > n // 2 and j > n // 2:
        if n - k < n - j:
            k = j
print((n, k))

n = int(eval(input()))
A = sorted(list(map(int, input().split())))
for i in range(n):
    if A[i] * 2 > A[-1]:
        ind = i
        break
ind -= 1
a = A[ind]
b = A[-1] - A[ind + 1]
if a >= b:
    print((A[-1], a))
else:
    print((A[-1], A[ind + 1]))

-N = int(eval(input())) +n = int(eval(input())) -n = A[-1] -k = A[0] -for i in range(1, N - 1): -    j = A[i] -    if k <= n // 2 and j <= n // 2: -        k = max(k, j) -    elif k <= n // 2 and j > n // 2: -        if k < n - j: -            k = j -    elif k > n // 2 and j <= n // 2: -        if n - k < j: -            k = j -    elif k > n // 2 and j > n // 2: -        if n - k < n - j: -            k = j -print((n, k)) +for i in range(n): +    if A[i] * 2 > A[-1]: +        ind = i +        break +ind -= 1 +a = A[ind] +b = A[-1] - A[ind + 1] +if a >= b: +    print((A[-1], a)) +else: +    print((A[-1], A[ind + 1]))