import math
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

print(reduce(math.gcd, A)) import math math from functools import reduce 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 print(reduce(math.gcd, A)) print reduce(math.gcd, A) reduce math.gcd math gcd A N = int(input()) int(input()) N A = list(map(int, input().split())) list(map(int, input().split())) A
import math
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

print(reduce(math.gcd, A))