N = int(eval(input()))

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

A.sort()



while(len(A) != 1):

  A_min = A.pop(0)

  A = [A[i]%A_min for i in range(len(A)) if A[i]%A_min > 0]

  A.append(A_min)

  A.sort()



print((A[0]))
from functools import reduce

from fractions import gcd

n = int(eval(input()))

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

print((reduce(gcd,a)))

N = int(eval(input()))
A = list(map(int, input().split()))
A.sort()
while len(A) != 1:
    A_min = A.pop(0)
    A = [A[i] % A_min for i in range(len(A)) if A[i] % A_min > 0]
    A.append(A_min)
    A.sort()
print((A[0]))

from functools import reduce
from fractions import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
print((reduce(gcd, a)))

-N = int(eval(input())) -A = list(map(int, input().split())) -A.sort() -while len(A) != 1: -    A_min = A.pop(0) -    A = [A[i] % A_min for i in range(len(A)) if A[i] % A_min > 0] -    A.append(A_min) -    A.sort() -print((A[0])) +from functools import reduce +from fractions import gcd + +n = int(eval(input())) +a = list(map(int, input().split())) +print((reduce(gcd, a)))