import math
n = int(input())
a_li = list(map(int,input().split()))
for i in range(n-1):
    a_li[i+1] = math.gcd(a_li[i],a_li[i+1])
print(a_li[i+1]) import math math n = int(input()) n int(input()) int input() input a_li = list(map(int,input().split())) a_li list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(n-1):
    a_li[i+1] = math.gcd(a_li[i],a_li[i+1]) i range(n-1) range n-1 n 1 a_li[i+1] = math.gcd(a_li[i],a_li[i+1]) a_li[i+1] a_li i+1 i 1 math.gcd(a_li[i],a_li[i+1]) math.gcd math gcd a_li[i] a_li i a_li[i+1] a_li i+1 i 1 print(a_li[i+1]) print a_li[i+1] a_li i+1 i 1 a_li = list(map(int,input().split())) list(map(int,input().split())) a_li n = int(input()) int(input()) n
import math
n = int(input())
a_li = list(map(int,input().split()))
for i in range(n-1):
    a_li[i+1] = math.gcd(a_li[i],a_li[i+1])
print(a_li[i+1])