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

#最大公約数
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

gcd_calc = A[0]
for a in A[1:]:
    gcd_calc = gcd(gcd_calc, a)

print(gcd_calc) 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(x, y):
    while y:
        x, y = y, x % y
    return x gcd while y:
        x, y = y, x % y
     y x, y = y, x % y x y y x % y x y return x x x x y y gcd_calc = A[0] gcd_calc A[0] A 0 for a in A[1:]:
    gcd_calc = gcd(gcd_calc, a) a A[1:] A 1: 1 gcd_calc = gcd(gcd_calc, a) gcd_calc gcd(gcd_calc, a) gcd gcd_calc a print(gcd_calc) print gcd_calc N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A def gcd(x, y):
    while y:
        x, y = y, x % y
    return x def gcd(x, y):
    while y:
        x, y = y, x % y
    return x gcd gcd_calc = A[0] A[0] gcd_calc gcd_calc = gcd(gcd_calc, a) gcd(gcd_calc, a) gcd_calc
N = int(input())
A = list(map(int, input().split()))

#最大公約数
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

gcd_calc = A[0]
for a in A[1:]:
    gcd_calc = gcd(gcd_calc, a)

print(gcd_calc)
