n=int(eval(input()))

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

B=A



while len(B)>1:

  C=[i for i in range(len(B))]

  C.remove(B.index(min(B)))

  d=min(B)



  for i in C:

    B[i]=B[i]%d

  while 0 in B:

    B.remove(0)

print((B[0]))
n=int(eval(input()))

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

ans=A[0]

def gcd(a,b):

    if b==0: return a

    else:

        return gcd(b,a%b)

def lcm(a,b):

    return a*b//gcd(a,b)



for i in range(n-1):

    ans=gcd(ans,A[i+1])

    if ans==1:

        print((1));exit()



print(ans)
n = int(eval(input()))
A = list(map(int, input().split()))
B = A
while len(B) > 1:
    C = [i for i in range(len(B))]
    C.remove(B.index(min(B)))
    d = min(B)
    for i in C:
        B[i] = B[i] % d
    while 0 in B:
        B.remove(0)
print((B[0]))

n = int(eval(input()))
A = list(map(int, input().split()))
ans = A[0]


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


def lcm(a, b):
    return a * b // gcd(a, b)


for i in range(n - 1):
    ans = gcd(ans, A[i + 1])
    if ans == 1:
        print((1))
        exit()
print(ans)

-B = A -while len(B) > 1: -    C = [i for i in range(len(B))] -    C.remove(B.index(min(B))) -    d = min(B) -    for i in C: -        B[i] = B[i] % d -    while 0 in B: -        B.remove(0) -print((B[0])) +ans = A[0] + + +def gcd(a, b): +    if b == 0: +        return a +    else: +        return gcd(b, a % b) + + +def lcm(a, b): +    return a * b // gcd(a, b) + + +for i in range(n - 1): +    ans = gcd(ans, A[i + 1]) +    if ans == 1: +        print((1)) +        exit() +print(ans)