import bisect



n=int(eval(input()))

a=[int(i) for i in input().split()]

a.sort()



nnn=a[n-1]

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

  

if k==n-1:

  rrr=a[n-2]

else:

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

    rrr=a[k-1]

  else:

    rrr=a[k]



print((nnn, rrr))

n=int(eval(input()))

a=[int(i) for i in input().split()]

 

enu=max(a)

a.remove(enu)



k=(enu)/2

sa=float("inf")

 

for i in range(n-1):

    if abs(k-a[i])<sa:

        sa=abs(k-a[i])

        aru=a[i]

 

print((enu,aru))
import bisect

n = int(eval(input()))
a = [int(i) for i in input().split()]
a.sort()
nnn = a[n - 1]
k = bisect.bisect_left(a[: n - 1], nnn / 2)
if k == n - 1:
    rrr = a[n - 2]
else:
    if abs(a[k - 1] - nnn / 2) < abs(a[k] - nnn / 2):
        rrr = a[k - 1]
    else:
        rrr = a[k]
print((nnn, rrr))

n = int(eval(input()))
a = [int(i) for i in input().split()]
enu = max(a)
a.remove(enu)
k = (enu) / 2
sa = float("inf")
for i in range(n - 1):
    if abs(k - a[i]) < sa:
        sa = abs(k - a[i])
        aru = a[i]
print((enu, aru))

-import bisect - -a.sort() -nnn = a[n - 1] -k = bisect.bisect_left(a[: n - 1], nnn / 2) -if k == n - 1: -    rrr = a[n - 2] -else: -    if abs(a[k - 1] - nnn / 2) < abs(a[k] - nnn / 2): -        rrr = a[k - 1] -    else: -        rrr = a[k] -print((nnn, rrr)) +enu = max(a) +a.remove(enu) +k = (enu) / 2 +sa = float("inf") +for i in range(n - 1): +    if abs(k - a[i]) < sa: +        sa = abs(k - a[i]) +        aru = a[i] +print((enu, aru))