import math
from functools import reduce

N = int(input())
A = list(map(int, input().split()))


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

answer = gcd(*A)
print(answer) 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 answer = gcd(*A) answer gcd(*A) gcd *A A print(answer) print answer 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 answer = gcd(*A) gcd(*A) answer
import math
from functools import reduce

N = int(input())
A = list(map(int, input().split()))


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

answer = gcd(*A)
print(answer)