import fractions as frac
n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for i in a:
    ans = frac.gcd(ans, i)

print(ans) import fractions as frac fractions 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 ans = a[0] ans a[0] a 0 for i in a:
    ans = frac.gcd(ans, i) i a ans = frac.gcd(ans, i) ans frac.gcd(ans, i) frac.gcd frac gcd ans i print(ans) print ans n = int(input()) int(input()) n ans = a[0] a[0] ans ans = frac.gcd(ans, i) frac.gcd(ans, i) ans a = list(map(int, input().split())) list(map(int, input().split())) a
import fractions as frac
n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for i in a:
    ans = frac.gcd(ans, i)

print(ans)