import fractions
from functools import reduce
def gcd_list(l):
    return reduce(fractions.gcd, l)
n = int(input())
A = list(map(int, input().split()))
print(gcd_list(A)) import fractions fractions from functools import reduce def gcd_list(l):
    return reduce(fractions.gcd, l) gcd_list return reduce(fractions.gcd, l) reduce(fractions.gcd, l) reduce fractions.gcd fractions gcd l l l n = int(input()) n int(input()) int input() input A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(gcd_list(A)) print gcd_list(A) gcd_list A A = list(map(int, input().split())) list(map(int, input().split())) A n = int(input()) int(input()) n def gcd_list(l):
    return reduce(fractions.gcd, l) def gcd_list(l):
    return reduce(fractions.gcd, l) gcd_list
import fractions
from functools import reduce
def gcd_list(l):
    return reduce(fractions.gcd, l)
n = int(input())
A = list(map(int, input().split()))
print(gcd_list(A))