import numpy as np;eval(input());a=list(map(int,input().split(' ')));m=max(a);a.remove(m);b=[abs(2*i-m) for i in a];j=b.index(min(b));print((m,a[j]))
eval(input());a=list(map(int,input().split(' ')));m=max(a);a.remove(m);b=[abs(2*i-m) for i in a];print((m,a[b.index(min(b))]))
import numpy as np

eval(input())
a = list(map(int, input().split(" ")))
m = max(a)
a.remove(m)
b = [abs(2 * i - m) for i in a]
j = b.index(min(b))
print((m, a[j]))

eval(input())
a = list(map(int, input().split(" ")))
m = max(a)
a.remove(m)
b = [abs(2 * i - m) for i in a]
print((m, a[b.index(min(b))]))

-import numpy as np - -j = b.index(min(b)) -print((m, a[j])) +print((m, a[b.index(min(b))]))