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