import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())
a = list(map(int, input().split()))
ans = gcd_list(a)
print(ans) import math math from functools import reduce def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers *numbers def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list return reduce(math.gcd, numbers) reduce(math.gcd, numbers) reduce math.gcd math gcd numbers numbers numbers 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 ans = gcd_list(a) ans gcd_list(a) gcd_list a print(ans) print ans n = int(input()) int(input()) n def gcd(*numbers):
    return reduce(math.gcd, numbers) def gcd(*numbers):
    return reduce(math.gcd, numbers) gcd a = list(map(int, input().split())) list(map(int, input().split())) a ans = gcd_list(a) gcd_list(a) ans def gcd_list(numbers):
    return reduce(math.gcd, numbers) def gcd_list(numbers):
    return reduce(math.gcd, numbers) gcd_list
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())
a = list(map(int, input().split()))
ans = gcd_list(a)
print(ans)