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