Let {\rm comb}(n,r) be the number of ways to choose r objects from among n objects, disregarding order. From n non-negative integers a_1, a_2, ..., a_n, select two numbers a_i > a_j so that {\rm comb}(a_i,a_j) is maximized. If there are multiple pairs that maximize the value, any of them is accepted.
n = int(input())
a = [int(s) for s in input().split()]

combn = max(a)

ar = [abs(num-combn/2) for num in a]
combr = int(combn/2 - min(ar))

print(' '.join(map(str,[combn,combr])))
n = int(input())
a = [int(s) for s in input().split()]

combn = max(a)

ar = [abs(num-combn/2) for num in a]
if int(combn/2 - min(ar)) in a:
  combr = int(combn/2 - min(ar))
else:
  combr = int(combn/2 + min(ar))

print(' '.join(map(str,[combn,combr])))