from bisect import bisect

n = int(eval(input()))

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



a.sort()



i = bisect(a, (a[-1]+1) // 2)



if a[i] - a[-1] / 2 < a[-1] / 2 - a[i-1]:

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

else:

    print((a[-1], a[i-1]))
n = int(eval(input()))

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



max_a = max(a)



ans = 0

for i in range(n):

    if abs(ans - max_a/2) > abs(a[i] - max_a/2):

        ans = a[i]



print((max_a, ans))
from bisect import bisect

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
i = bisect(a, (a[-1] + 1) // 2)
if a[i] - a[-1] / 2 < a[-1] / 2 - a[i - 1]:
    print((a[-1], a[i]))
else:
    print((a[-1], a[i - 1]))

n = int(eval(input()))
a = list(map(int, input().split()))
max_a = max(a)
ans = 0
for i in range(n):
    if abs(ans - max_a / 2) > abs(a[i] - max_a / 2):
        ans = a[i]
print((max_a, ans))

-from bisect import bisect - -a.sort() -i = bisect(a, (a[-1] + 1) // 2) -if a[i] - a[-1] / 2 < a[-1] / 2 - a[i - 1]: -    print((a[-1], a[i])) -else: -    print((a[-1], a[i - 1])) +max_a = max(a) +ans = 0 +for i in range(n): +    if abs(ans - max_a / 2) > abs(a[i] - max_a / 2): +        ans = a[i] +print((max_a, ans))