import math
from functools import reduce

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

n = int(input())
*a, = map(int, input().split())
print(gcd(*a)) import math math from functools import reduce def gcd(*n):
    return reduce(math.gcd, n) gcd return reduce(math.gcd, n) reduce(math.gcd, n) reduce math.gcd math gcd n *n n = int(input()) n int(input()) int input() input *a, = map(int, input().split()) *a a map(int, input().split()) map int input().split() ().split () input split print(gcd(*a)) print gcd(*a) gcd *a a n = int(input()) int(input()) n def gcd(*n):
    return reduce(math.gcd, n) def gcd(*n):
    return reduce(math.gcd, n) gcd
import math
from functools import reduce

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

n = int(input())
*a, = map(int, input().split())
print(gcd(*a))