n,*a=list(map(int,open(0).read().split()))

a.sort()

b=a[-1]

c=a[0]

d=b/2-c

for i in a:

    if d>abs(b/2-i):

        c=i

        d=abs(b/2-i)

print((b,c))
n,*a=list(map(int,open(0).read().split()))

n=max(a)

print((n,min((abs(n/2-i),i)for i in a)[1]))
n, *a = list(map(int, open(0).read().split()))
a.sort()
b = a[-1]
c = a[0]
d = b / 2 - c
for i in a:
    if d > abs(b / 2 - i):
        c = i
        d = abs(b / 2 - i)
print((b, c))

n, *a = list(map(int, open(0).read().split()))
n = max(a)
print((n, min((abs(n / 2 - i), i) for i in a)[1]))

-a.sort() -b = a[-1] -c = a[0] -d = b / 2 - c -for i in a: -    if d > abs(b / 2 - i): -        c = i -        d = abs(b / 2 - i) -print((b, c)) +n = max(a) +print((n, min((abs(n / 2 - i), i) for i in a)[1]))