from math import *
n=int(input())
l=list(map(int,input().split()))
g=l[0]
for i in range(1,n):
    g=gcd(g,l[i])
print(g) from math import * n=int(input()) n int(input()) int input() input l=list(map(int,input().split())) l list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split g=l[0] g l[0] l 0 for i in range(1,n):
    g=gcd(g,l[i]) i range(1,n) range 1 n g=gcd(g,l[i]) g gcd(g,l[i]) gcd g l[i] l i print(g) print g l=list(map(int,input().split())) list(map(int,input().split())) l n=int(input()) int(input()) n g=l[0] l[0] g g=gcd(g,l[i]) gcd(g,l[i]) g
from math import *
n=int(input())
l=list(map(int,input().split()))
g=l[0]
for i in range(1,n):
    g=gcd(g,l[i])
print(g)