n=int(eval(input()))

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

A=sorted(A,reverse=True)

p=A[0]

c=p/2

q=0

for i in A[1:]:

    if abs(q-c)>=abs(i-c):

        q=i

print((p,q))
n=int(eval(input()))

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

p=max(A)

c=p/2

q=0

for i in A:

    if abs(q-c)>=abs(i-c):

        q=i

print((p,q))
n = int(eval(input()))
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
p = A[0]
c = p / 2
q = 0
for i in A[1:]:
    if abs(q - c) >= abs(i - c):
        q = i
print((p, q))

n = int(eval(input()))
A = list(map(int, input().split()))
p = max(A)
c = p / 2
q = 0
for i in A:
    if abs(q - c) >= abs(i - c):
        q = i
print((p, q))

-A = sorted(A, reverse=True) -p = A[0] +p = max(A) -for i in A[1:]: +for i in A: