n = int(eval(input()))

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

A_max = A.pop()

n = A_max/2

n = min([(abs(n-i), i) for i in A], key=lambda x:x[0])[1]

print((A_max, n))
n = int(eval(input()))

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

A_max = A.pop()

print((A_max, min(A, key=lambda x:abs(A_max-x*2))))
n = int(eval(input()))
A = sorted(list(map(int, input().split())))
A_max = A.pop()
n = A_max / 2
n = min([(abs(n - i), i) for i in A], key=lambda x: x[0])[1]
print((A_max, n))

n = int(eval(input()))
A = sorted([int(i) for i in input().split()])
A_max = A.pop()
print((A_max, min(A, key=lambda x: abs(A_max - x * 2))))

-A = sorted(list(map(int, input().split()))) +A = sorted([int(i) for i in input().split()]) -n = A_max / 2 -n = min([(abs(n - i), i) for i in A], key=lambda x: x[0])[1] -print((A_max, n)) +print((A_max, min(A, key=lambda x: abs(A_max - x * 2))))