import numpy as np

n = int(input())
a = list(map(int,input().split()))

ans = a[0]

for i in range(1,len(a)):
    ans = np.gcd(a[i],ans)

print(ans) import numpy as np numpy 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 range(1,len(a)):
    ans = np.gcd(a[i],ans) i range(1,len(a)) range 1 len(a) len a ans = np.gcd(a[i],ans) ans np.gcd(a[i],ans) np.gcd np gcd a[i] a i ans print(ans) print ans a = list(map(int,input().split())) list(map(int,input().split())) a ans = a[0] a[0] ans n = int(input()) int(input()) n ans = np.gcd(a[i],ans) np.gcd(a[i],ans) ans
import numpy as np

n = int(input())
a = list(map(int,input().split()))

ans = a[0]

for i in range(1,len(a)):
    ans = np.gcd(a[i],ans)

print(ans)