n = int(eval(input()))

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





ans=a.pop(a.index(max(a)))



for i in range(n - 1):

    if a[i] > ans / 2:

        a[i] = [ans - a[i],a[i]]

    else:

        a[i] = [a[i],a[i]]

a = sorted(a,reverse = True)



print((str(ans) + " " + str(a[0][1])))
import math

import bisect





n = int(eval(input()))



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

a.sort()



ncr = 0

ans = [0, 0]



id = bisect.bisect_left(a[:n-1], a[n-1]//2)

if abs(a[-1]/2 - a[id]) < abs(a[-1]/2 - a[id-1]):

    ans = id

else:

    ans = id-1



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

n = int(eval(input()))
a = list(map(int, input().split()))
ans = a.pop(a.index(max(a)))
for i in range(n - 1):
    if a[i] > ans / 2:
        a[i] = [ans - a[i], a[i]]
    else:
        a[i] = [a[i], a[i]]
a = sorted(a, reverse=True)
print((str(ans) + " " + str(a[0][1])))

import math
import bisect

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ncr = 0
ans = [0, 0]
id = bisect.bisect_left(a[: n - 1], a[n - 1] // 2)
if abs(a[-1] / 2 - a[id]) < abs(a[-1] / 2 - a[id - 1]):
    ans = id
else:
    ans = id - 1
print((a[-1], a[ans]))

+import math +import bisect + -ans = a.pop(a.index(max(a))) -for i in range(n - 1): -    if a[i] > ans / 2: -        a[i] = [ans - a[i], a[i]] -    else: -        a[i] = [a[i], a[i]] -a = sorted(a, reverse=True) -print((str(ans) + " " + str(a[0][1]))) +a.sort() +ncr = 0 +ans = [0, 0] +id = bisect.bisect_left(a[: n - 1], a[n - 1] // 2) +if abs(a[-1] / 2 - a[id]) < abs(a[-1] / 2 - a[id - 1]): +    ans = id +else: +    ans = id - 1 +print((a[-1], a[ans]))