N = int(eval(input()))

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



A.sort()

n = A[-1]



m = n / 2

r = 0

for i in range(N - 1):

    if abs(m - A[i]) < abs(m - r):

        r = A[i]



print((n, r))

def check(n, m):

    l = n // 2

    r = l + (n % 2 == 1)



    return min(abs(l - m), abs(r - m))





N = int(eval(input()))

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



A.sort()

n = A[-1]

pd = float('inf')

for i in range(N - 1):

    a = A[i]

    d = check(n, a)

    if d < pd:

        b = a

        pd = d

print((n, b))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
n = A[-1]
m = n / 2
r = 0
for i in range(N - 1):
    if abs(m - A[i]) < abs(m - r):
        r = A[i]
print((n, r))

def check(n, m):
    l = n // 2
    r = l + (n % 2 == 1)
    return min(abs(l - m), abs(r - m))


N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
n = A[-1]
pd = float("inf")
for i in range(N - 1):
    a = A[i]
    d = check(n, a)
    if d < pd:
        b = a
        pd = d
print((n, b))

+def check(n, m): +    l = n // 2 +    r = l + (n % 2 == 1) +    return min(abs(l - m), abs(r - m)) + + -m = n / 2 -r = 0 +pd = float("inf") -    if abs(m - A[i]) < abs(m - r): -        r = A[i] -print((n, r)) +    a = A[i] +    d = check(n, a) +    if d < pd: +        b = a +        pd = d +print((n, b))