from operator import mul

from functools import reduce

import bisect



def cmb(n,r):

    r = min(n-r,r)

    if r == 0: return 1

    over = reduce(mul, list(range(n, n - r, -1)))

    under = reduce(mul, list(range(1,r + 1)))

    return over // under



N = int(eval(input()))

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

maxA = max(A)

A.remove(maxA)

idx = bisect.bisect(A,maxA//2)



if idx == len(A):

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

elif idx == 0:

  print((maxA, idx))

else:

  if abs(maxA//2 - A[idx]) > abs(maxA//2 - A[idx-1]):

    print((maxA,A[idx-1]))

  else:

    print((maxA,A[idx]))
N = int(eval(input()))

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



n = A[-1]

r_val = -float('inf')

r_row = None

for idx in range(N - 1):

    if r_val < min(n - A[idx], A[idx]):

        r_val = min(n - A[idx], A[idx])

        r_row = A[idx]

print((n, r_row))

from operator import mul
from functools import reduce
import bisect


def cmb(n, r):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, list(range(n, n - r, -1)))
    under = reduce(mul, list(range(1, r + 1)))
    return over // under


N = int(eval(input()))
A = sorted(list(map(int, input().split())))
maxA = max(A)
A.remove(maxA)
idx = bisect.bisect(A, maxA // 2)
if idx == len(A):
    print((maxA, A[-1]))
elif idx == 0:
    print((maxA, idx))
else:
    if abs(maxA // 2 - A[idx]) > abs(maxA // 2 - A[idx - 1]):
        print((maxA, A[idx - 1]))
    else:
        print((maxA, A[idx]))

N = int(eval(input()))
A = sorted(list(map(int, input().split())))
n = A[-1]
r_val = -float("inf")
r_row = None
for idx in range(N - 1):
    if r_val < min(n - A[idx], A[idx]):
        r_val = min(n - A[idx], A[idx])
        r_row = A[idx]
print((n, r_row))

-from operator import mul -from functools import reduce -import bisect - - -def cmb(n, r): -    r = min(n - r, r) -    if r == 0: -        return 1 -    over = reduce(mul, list(range(n, n - r, -1))) -    under = reduce(mul, list(range(1, r + 1))) -    return over // under - - -maxA = max(A) -A.remove(maxA) -idx = bisect.bisect(A, maxA // 2) -if idx == len(A): -    print((maxA, A[-1])) -elif idx == 0: -    print((maxA, idx)) -else: -    if abs(maxA // 2 - A[idx]) > abs(maxA // 2 - A[idx - 1]): -        print((maxA, A[idx - 1])) -    else: -        print((maxA, A[idx])) +n = A[-1] +r_val = -float("inf") +r_row = None +for idx in range(N - 1): +    if r_val < min(n - A[idx], A[idx]): +        r_val = min(n - A[idx], A[idx]) +        r_row = A[idx] +print((n, r_row))