import math
from functools import reduce
n=int(input())
a=list(map(int,input().split()))

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

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

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

print(gcd(a))