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

n, *a = map(int, open(0).read().split())
print(reduce(gcd, a)) from functools import reduce from math import gcd n, *a = map(int, open(0).read().split()) n map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *a a print(reduce(gcd, a)) print reduce(gcd, a) reduce gcd a n, *a = map(int, open(0).read().split()) map(int, open(0).read().split()) n
#!/usr/bin/env python3
from functools import reduce
from math import gcd

n, *a = map(int, open(0).read().split())
print(reduce(gcd, a))
