Recently you have received two positive integer numbers $x$ and $y$. You forgot them, but you remembered a shuffled list containing all divisors of $x$ (including $1$ and $x$) and all divisors of $y$ (including $1$ and $y$). If $d$ is a divisor of both numbers $x$ and $y$ at the same time, there are two occurrences of $d$ in the list.

For example, if $x=4$ and $y=6$ then the given list can be any permutation of the list $[1, 2, 4, 1, 2, 3, 6]$. Some of the possible lists are: $[1, 1, 2, 4, 6, 3, 2]$, $[4, 6, 1, 1, 2, 3, 2]$ or $[1, 6, 3, 2, 4, 1, 2]$.

Your problem is to restore suitable positive integer numbers $x$ and $y$ that would yield the same list of divisors (possibly in different order).

It is guaranteed that the answer exists, i.e. the given list of divisors corresponds to some positive integers $x$ and $y$.


-----Input-----

The first line contains one integer $n$ ($2 \le n \le 128$) — the number of divisors of $x$ and $y$.

The second line of the input contains $n$ integers $d_1, d_2, \dots, d_n$ ($1 \le d_i \le 10^4$), where $d_i$ is either divisor of $x$ or divisor of $y$. If a number is divisor of both numbers $x$ and $y$ then there are two copies of this number in the list.


-----Output-----

Print two positive integer numbers $x$ and $y$ — such numbers that merged list of their divisors is the permutation of the given list of integers. It is guaranteed that the answer exists.


-----Example-----
Input
10
10 2 8 1 2 4 1 20 4 5

Output
20 8

Difficulty: introductory

Starter code:

Solutions:
n = int(input())

seq = sorted(list(map(int, input().split())))[::-1]

a = seq[0]
last = -1
for i in range(len(seq)):
    if a % seq[i] == 0:
        if last != seq[i]:
            last = seq[i]
        else:
            b = seq[i]
            break
    else:
        b = seq[i]
        break
print(a, b)


input()
a = list(map(int, input().split()))
a.sort(reverse=True)
x = a[0]
y1 = x + 1
for y in a:
    if x % y or y == y1:
        print(x, y)
        break
    y1 = y


n = int(input())
A = list(map(int, input().split()))
A.sort()
x = A[-1]
used = [0] * (x + 1)
y = 0
for i in A:
    if x % i == 0:
        if used[i] == 1:
            y = max(y, i)
        else:
            used[i] = 1
    else:
        y = max(y, i)
print(x, y)

def get():
    return list(map(int,input().split()))
n=int(input())
a=get()
s=max(a)
a.remove(s)
for i in range(1,s//2+1):
    if s%i==0:
        a.remove(i)
print(s,max(a))


n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
r = a[-1]
for i in range(1,r+1):
    if r%i==0:
        a.remove(i)
a = sorted(a)
t = a[-1]
print(r,t)


input()
ds = list(map(int, input().split()))
x = max(ds)
for v in {v for v in ds if x % v == 0}:
    ds.remove(v)
y = max(ds)
print(x, y)


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

a = max(d)

for i in range(2, a + 1):
	if a % i == 0:
		d.remove(i)

print(a, max(d))

n=int(input())
A=list(map(int,input().split()))
x=max(A)

from collections import Counter
counter=Counter(A)

import math
xr=math.ceil(math.sqrt(x))

LIST=[]
for i in range(1,xr+1):
    if x%i==0:
        LIST.append(i)
        LIST.append(x//i)

LIST=set(LIST)

for l in LIST:
    counter[l]-=1

REST=[i for i in list(counter.keys()) if counter[i]!=0]
y=max(REST)

print(x,y)


n = int(input())

nums = [int(c) for c in input().split(" ")]
# nums.sort()

occur = {}
for num in nums:
    if num not in occur: occur[num] = 0
    occur[num] += 1

gcd = 1
for num in occur:
    if occur[num] == 2: gcd = max(gcd, num)

b = max(nums)

#print(occur)

for num in occur:
    if b%num == 0:
        occur[num] -= 1

#print(occur)

a = 1
for num in occur:
    if occur[num] == 1:
        a = max(a, num)

print(a, b)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
b = []
for i in range(1, x + 1) :
    if x % i == 0 :
        b.append(i)

for i in range(len(b)) :
    a.remove(b[i])

print(x, max(a))


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

x = a[-1]
while a:
    d = a.pop()
    if x % d != 0 or a and a[-1] == d:
        y = d
        break
print(x, y)


n=int(input())
a=list(map(int,input().split()))
a.sort()
num=max(a)
d=dict()
for i in range(n):
    d[a[i]]=0
for i in range(n):
    d[a[i]]+=1
a=list(set(a))
v=[]
for i in range(len(a)):
    if d[a[i]]==2 or num%a[i]!=0:
        v.append(a[i])
num2=max(v)
print(num,num2)
    


n=int(input())
a=list(map(int,input().split()))
a.sort()
maxi=a[n-1]
for i in range(1,maxi+1,1):
	if(maxi%i==0):
		a.remove(i)
m2=max(a)
print(maxi,m2)

n = int(input())
d = [ int(a) for a in input().split() ]

d.sort()

big = d[-1]
for x in range(1, big+1):
    if big % x == 0:
        d.remove(x)

print(big, d[-1])


# map(int,input().split(" "))

n=int(input())

l=list(map(int,input().split(" ")))


m=max(l)

i=1;

while (i*i<=m):
	if(m%i==0):
		if(len(l)>0 and (i in l)):
			l.remove(i)
		if(len(l)>0 and ((m//i) in l) and (i!=(m//i))):
			l.remove(m//i)
	i+=1

print(m,max(l))
# print(l)




input()

lst = list(map(int, input().split()))
lst.sort()
first = lst[-1]

i = 1
while i <= first:
    if first % i == 0:
        lst.remove(i)
    i += 1

print(first, lst[-1])


t=1
j=0
for i in range(10):
    j+=1
for _ in range(1):
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    num=max(a)
    d=dict()
    for i in range(n):
        d[a[i]]=0
    for i in range(n):
        d[a[i]]+=1
    a=list(set(a))
    v=[]
    for i in range(len(a)):
        if d[a[i]]==2 or num%a[i]!=0:
            v.append(a[i])
    num2=max(v)
    print(num,num2)
    


import math

def divisorGenerator(n):
    large_divisors = []
    for i in range(1, int(math.sqrt(n) + 1)):
        if n % i == 0:
            yield i
            if i*i != n:
                large_divisors.append(n / i)
    for divisor in reversed(large_divisors):
        yield divisor

n = int(input())
a = list(map(int, input().split()))
n1 = max(a)
for i in divisorGenerator(n1):
    a.remove(i)
n2 = max(a)
print('{} {}'.format(n1, n2))


from math import gcd
n = int(input())
k = []
p = []
arr = [int(x) for x in input().split()]
g = max(arr)
print(g, end = ' ')
for i in arr:
    if (g % i == 0) and i not in k:
        k.append(i)
    else:
        p.append(i)
lcm = p[0]
for i in p[1:]:
    lcm = lcm*i//gcd(lcm, i)
print(lcm)

n = int(input())
d = [int(t) for t in input().split(' ')]
d.sort()
d.reverse()

d1 = d[0]
d2 = None
for i in range(1, len(d)):
    if d1 % d[i] != 0 or d[i] == d[i-1]:
        d2 = d[i]
        break
print(d1, d2)

n = int(input())
a = list(map(int, input().split()))
x = max(a)
s = set()
i = 0
while i < len(a):
    if x % a[i] == 0:
        t = len(s)
        s.add(a[i])
        if len(s) > t:
            a.pop(i)
        else:
            i += 1
    else:
        i += 1
print(x, max(a))

n=int(input())
a=[int(i) for i in input().split()]
k=max(a)
b=[]
c=set()
for i in range(n):
    if k%a[i]==0 and a[i] not in c:
        c.add(a[i])
    else:
        b.append(a[i])
print(k,max(b))

a=int(input())
b=list(map(int,input().split()))
x=max(b)
for i in range(1,x+1):
    if x%i==0:
        b.remove(i)
print(x,max(b))


n = int(input())
d = list(map(int, input().split()))
d.sort(reverse = True)
x = d[0]
x_yakusuu = []
for i in range(1, 10001):
    if x % i == 0:
        x_yakusuu.append(i)
for i in x_yakusuu:
    d.remove(i)
d.sort(reverse = True)
print(str(x)+" "+str(d[0]))


n=int(input())
A=list(map(int,input().split()))
x=max(A)
for i in range(1,x+1):
    if(x%i==0):
        A.remove(i)
y=max(A)
print(x,y)