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