n=int(eval(input()))

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

mx=max(a)

d=mx

ans=0

if n==2:

  print((100,0))

  exit()

for i in a:

  if abs(i-mx/2)<d:

    d=abs(i-mx/2)

    ans=i

print((mx,ans))



n=int(eval(input()))

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

mx=max(a)

d=mx/2

ans=0

for i in a:

  if abs(i-mx/2)<d:

    d=abs(i-mx/2)

    ans=i

print((mx,ans))
n = int(eval(input()))
a = list(map(int, input().split()))
mx = max(a)
d = mx
ans = 0
if n == 2:
    print((100, 0))
    exit()
for i in a:
    if abs(i - mx / 2) < d:
        d = abs(i - mx / 2)
        ans = i
print((mx, ans))

n = int(eval(input()))
a = list(map(int, input().split()))
mx = max(a)
d = mx / 2
ans = 0
for i in a:
    if abs(i - mx / 2) < d:
        d = abs(i - mx / 2)
        ans = i
print((mx, ans))

-d = mx +d = mx / 2 -if n == 2: -    print((100, 0)) -    exit()