n = int(eval(input()))

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

a.sort()

dis = [abs(a[-1]/2 - a[i]) for i in range(n-1)]

r = a[dis.index(min(dis))]

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

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

m = max(a)

del a[a.index(m)]

dis = [abs(m/2 - a[i]) for i in range(n-1)]

r = a[dis.index(min(dis))]

print((m,r))
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
dis = [abs(a[-1] / 2 - a[i]) for i in range(n - 1)]
r = a[dis.index(min(dis))]
print((a[-1], r))

n = int(eval(input()))
a = list(map(int, input().split()))
m = max(a)
del a[a.index(m)]
dis = [abs(m / 2 - a[i]) for i in range(n - 1)]
r = a[dis.index(min(dis))]
print((m, r))

-a.sort() -dis = [abs(a[-1] / 2 - a[i]) for i in range(n - 1)] +m = max(a) +del a[a.index(m)] +dis = [abs(m / 2 - a[i]) for i in range(n - 1)] -print((a[-1], r)) +print((m, r))