# 62 C - Monsters Battle Royale
import math
import functools
N = int(input())
A = list(map(int,input().split()))

# すべての要素の GCD
ans = functools.reduce(math.gcd,A)
print(ans) import math math import functools functools 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 = functools.reduce(math.gcd,A) ans functools.reduce(math.gcd,A) functools.reduce functools reduce math.gcd math gcd A print(ans) print ans N = int(input()) int(input()) N ans = functools.reduce(math.gcd,A) functools.reduce(math.gcd,A) ans A = list(map(int,input().split())) list(map(int,input().split())) A
# 62 C - Monsters Battle Royale
import math
import functools
N = int(input())
A = list(map(int,input().split()))

# すべての要素の GCD
ans = functools.reduce(math.gcd,A)
print(ans)