n = int(eval(input()))

ls = sorted(map(int, input().split()))

ds = [abs(x - ls[-1] / 2) for x in ls[:-1]]

print((ls[-1], ls[ds.index(min(ds))]))
n = int(eval(input()))

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

m = max(ls)

ls.remove(m)

ds = [abs(x - m / 2) for x in ls]

print((m, ls[ds.index(min(ds))]))
n = int(eval(input()))
ls = sorted(map(int, input().split()))
ds = [abs(x - ls[-1] / 2) for x in ls[:-1]]
print((ls[-1], ls[ds.index(min(ds))]))

n = int(eval(input()))
ls = list(map(int, input().split()))
m = max(ls)
ls.remove(m)
ds = [abs(x - m / 2) for x in ls]
print((m, ls[ds.index(min(ds))]))

-ls = sorted(map(int, input().split())) -ds = [abs(x - ls[-1] / 2) for x in ls[:-1]] -print((ls[-1], ls[ds.index(min(ds))])) +ls = list(map(int, input().split())) +m = max(ls) +ls.remove(m) +ds = [abs(x - m / 2) for x in ls] +print((m, ls[ds.index(min(ds))]))