n=int(eval(input()))

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

m=a[n-1]

a=a[:n]

h=m/2

d=abs(a[0]-h)

x=0

for i in range(1,n-1):

  if abs(a[i]-h)<d:

    x=i

    d=abs(a[i]-h)

print((m,a[x]))
n=int(eval(input()))

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

if len(a)==2:

  print((*a[::-1]))

else:

  m=a[n-1]

  a=a[:n-1]

  h=m/2

  import bisect as bi

  x=bi.bisect_left(a,h)

  print((m,a[x-(a[x]-h>h-a[x-1])]))
n = int(eval(input()))
a = sorted(list(map(int, input().split())))
m = a[n - 1]
a = a[:n]
h = m / 2
d = abs(a[0] - h)
x = 0
for i in range(1, n - 1):
    if abs(a[i] - h) < d:
        x = i
        d = abs(a[i] - h)
print((m, a[x]))

n = int(eval(input()))
a = sorted(list(map(int, input().split())))
if len(a) == 2:
    print((*a[::-1]))
else:
    m = a[n - 1]
    a = a[: n - 1]
    h = m / 2
    import bisect as bi

    x = bi.bisect_left(a, h)
    print((m, a[x - (a[x] - h > h - a[x - 1])]))

-m = a[n - 1] -a = a[:n] -h = m / 2 -d = abs(a[0] - h) -x = 0 -for i in range(1, n - 1): -    if abs(a[i] - h) < d: -        x = i -        d = abs(a[i] - h) -print((m, a[x])) +if len(a) == 2: +    print((*a[::-1])) +else: +    m = a[n - 1] +    a = a[: n - 1] +    h = m / 2 +    import bisect as bi + +    x = bi.bisect_left(a, h) +    print((m, a[x - (a[x] - h > h - a[x - 1])]))