n = int(eval(input()))

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



a = sorted(a, reverse=True)

half = a[0] / 2

sa = float("inf")

ans = 0

for i in a[1:]:

    if abs(half - i) < sa:

        ans = i

        sa = abs(half - i)



print((a[0], ans))
n = int(eval(input()))

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



m = max(a)

half = m / 2

sa = float("inf")

ans = 0

for i in a:

    if i != m:

        if abs(half - i) < sa:

            ans = i

            sa = abs(half - i)



print((m, ans))
n = int(eval(input()))
a = list(map(int, input().split()))
a = sorted(a, reverse=True)
half = a[0] / 2
sa = float("inf")
ans = 0
for i in a[1:]:
    if abs(half - i) < sa:
        ans = i
        sa = abs(half - i)
print((a[0], ans))

n = int(eval(input()))
a = list(map(int, input().split()))
m = max(a)
half = m / 2
sa = float("inf")
ans = 0
for i in a:
    if i != m:
        if abs(half - i) < sa:
            ans = i
            sa = abs(half - i)
print((m, ans))

-a = sorted(a, reverse=True) -half = a[0] / 2 +m = max(a) +half = m / 2 -for i in a[1:]: -    if abs(half - i) < sa: -        ans = i -        sa = abs(half - i) -print((a[0], ans)) +for i in a: +    if i != m: +        if abs(half - i) < sa: +            ans = i +            sa = abs(half - i) +print((m, ans))