from math import gcd
from functools import reduce

input()
a = list(map(int, input().split()))
print(reduce(gcd, a)) from math import gcd from functools import reduce 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 print(reduce(gcd, a)) print reduce(gcd, a) reduce gcd a a = list(map(int, input().split())) list(map(int, input().split())) a
from math import gcd
from functools import reduce

input()
a = list(map(int, input().split()))
print(reduce(gcd, a))