#!/usr/bin/env python3

from fractions import gcd

from functools import reduce

N = int(eval(input()))

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

print((reduce(gcd, A)))

from math import gcd



n = int(eval(input()))

a = list(map(int, input().split()))

g = 0

for x in a:

    g = gcd(g, x)

print(g)

#!/usr/bin/env python3
from fractions import gcd
from functools import reduce

N = int(eval(input()))
A = list(map(int, input().split()))
print((reduce(gcd, A)))

from math import gcd

n = int(eval(input()))
a = list(map(int, input().split()))
g = 0
for x in a:
    g = gcd(g, x)
print(g)

-#!/usr/bin/env python3 -from fractions import gcd -from functools import reduce +from math import gcd -N = int(eval(input())) -A = list(map(int, input().split())) -print((reduce(gcd, A))) +n = int(eval(input())) +a = list(map(int, input().split())) +g = 0 +for x in a: +    g = gcd(g, x) +print(g)