N = int(eval(input()))

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

a.sort()

n = a[-1]

diff = 10**18

r = -1



for ai in a:

    if abs(n-2*ai)<diff:

        diff = abs(n-2*ai)

        r = ai



print((n, r))
import sys

input = sys.stdin.readline



n = int(eval(input()))

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

a.sort()

l = [ai for ai in a[:-1]]

l.sort(key=lambda x: abs(a[-1]/2-x))

print((a[-1], l[0]))
N = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
n = a[-1]
diff = 10**18
r = -1
for ai in a:
    if abs(n - 2 * ai) < diff:
        diff = abs(n - 2 * ai)
        r = ai
print((n, r))

import sys

input = sys.stdin.readline
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
l = [ai for ai in a[:-1]]
l.sort(key=lambda x: abs(a[-1] / 2 - x))
print((a[-1], l[0]))

-N = int(eval(input())) +import sys + +input = sys.stdin.readline +n = int(eval(input())) -n = a[-1] -diff = 10**18 -r = -1 -for ai in a: -    if abs(n - 2 * ai) < diff: -        diff = abs(n - 2 * ai) -        r = ai -print((n, r)) +l = [ai for ai in a[:-1]] +l.sort(key=lambda x: abs(a[-1] / 2 - x)) +print((a[-1], l[0]))