import sys
import heapq
def gcd(a,b):
if b == 0 :
return a
return gcd(b, a % b)
n = int(sys.stdin.readline())
L = list(map(int,sys.stdin.readline().split()))
X2 = []
g = 0
for i in range(n):
g = gcd(g, L[i])
for i in range(n):
L[i] = L[i] // g
for i in range(n):
a = L[i]
zz = 0
while (a % 2 == 0):
a = a // 2
zz += 1
X2.append(zz)
X2.sort()
power = [0 for i in range(100)]
for x in X2:
power[x] += 1
aa = 0
for i in range(99):
if power[i] != 0:
if power[i] == 1 and power[i + 1] == 0:
aa = i
break
power[i + 1] += power[i] // 2
power[i] = 0
if sum(power[aa + 1:]) >= 1:
aa += 1
print(g * (1 << aa))