def gcd(a,b):

	return a if b==0 else gcd(b,a%b)



n=eval(input())

if n==2:

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

	g=gcd(a,b)

else:

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

	g=gcd(gcd(a,b),c)

for i in range(1,g+1):

		if gcd(i,g)==i:print(i)
from fractions import gcd
from functools import reduce

n=eval(input())

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

g=reduce(gcd,L)

for i in range(1,g+1):

    if g%i==0:print(i)
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


n = eval(input())
if n == 2:
    a, b = list(map(int, input().split()))
    g = gcd(a, b)
else:
    a, b, c = list(map(int, input().split()))
    g = gcd(gcd(a, b), c)
for i in range(1, g + 1):
    if gcd(i, g) == i:
        print(i)

from fractions import gcd
from functools import reduce

n = eval(input())
L = list(map(int, input().split()))
g = reduce(gcd, L)
for i in range(1, g + 1):
    if g % i == 0:
        print(i)

-def gcd(a, b): -    return a if b == 0 else gcd(b, a % b) - +from fractions import gcd +from functools import reduce -if n == 2: -    a, b = list(map(int, input().split())) -    g = gcd(a, b) -else: -    a, b, c = list(map(int, input().split())) -    g = gcd(gcd(a, b), c) +L = list(map(int, input().split())) +g = reduce(gcd, L) -    if gcd(i, g) == i: +    if g % i == 0: