from math import gcd
N = int(input())
A = list(map(int,input().split()))
ans = A[0]

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

for e in A:
    ans = gcd(e,ans)
print(ans)