import fractions
n,*a=map(int,open(0).read().split())
e=fractions.gcd(a[0],a[1])
for i in range(1,n):
    e=fractions.gcd(e,a[i])

print(e) import fractions fractions 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 e=fractions.gcd(a[0],a[1]) e fractions.gcd(a[0],a[1]) fractions.gcd fractions gcd a[0] a 0 a[1] a 1 for i in range(1,n):
    e=fractions.gcd(e,a[i]) i range(1,n) range 1 n e=fractions.gcd(e,a[i]) e fractions.gcd(e,a[i]) fractions.gcd fractions gcd e a[i] a i print(e) print e e=fractions.gcd(e,a[i]) fractions.gcd(e,a[i]) e n,*a=map(int,open(0).read().split()) map(int,open(0).read().split()) n e=fractions.gcd(a[0],a[1]) fractions.gcd(a[0],a[1]) e
import fractions
n,*a=map(int,open(0).read().split())
e=fractions.gcd(a[0],a[1])
for i in range(1,n):
    e=fractions.gcd(e,a[i])

print(e)