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