_ = int(input())
a = list(map(int, input().split()))
a.sort()
n = max(a)
a = a[:-1]
rc = float('inf')
rd = 0
r = 0
for i in a:
    if rc > abs(i - n / 2):
        r = i
    rc = min(rc, abs(i - n / 2))
print(n, r)

51cba38d6d5c7ca80b12418db3f8e68b6198e9cd
<mask token>

<mask token>
a.sort()
<mask token>
for i in a:
    if rc > abs(i - n / 2):
        r = i
    rc = min(rc, abs(i - n / 2))
print(n, r)

_ = int(input())
a = list(map(int, input().split()))
a.sort()
n = max(a)
a = a[:-1]
rc = float('inf')
rd = 0
r = 0
for i in a:
    if rc > abs(i - n / 2):
        r = i
    rc = min(rc, abs(i - n / 2))
print(n, r)
