# -*- coding: utf-8 -*-
import sys
from math import gcd
from itertools import product
def inpl(): return list(map(int, input().split()))

N = int(input())
A = inpl()
a = A[0]
for b in A[1:]:
    a = gcd(a, b)
print(a) import sys sys from math import gcd from itertools import product def inpl(): return list(map(int, input().split())) inpl N = int(input()) N int(input()) int input() input A = inpl() A inpl() inpl a = A[0] a A[0] A 0 for b in A[1:]:
    a = gcd(a, b) b A[1:] A 1: 1 a = gcd(a, b) a gcd(a, b) gcd a b print(a) print a N = int(input()) int(input()) N a = A[0] A[0] a def inpl(): return list(map(int, input().split())) def inpl(): return list(map(int, input().split())) inpl a = gcd(a, b) gcd(a, b) a A = inpl() inpl() A
# -*- coding: utf-8 -*-
import sys
from math import gcd
from itertools import product
def inpl(): return list(map(int, input().split()))

N = int(input())
A = inpl()
a = A[0]
for b in A[1:]:
    a = gcd(a, b)
print(a)