from copy import deepcopy
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools
import copy


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
# print(a)
tmp = gcd(0, a[0])
for i in range(1, n):
    tmp = gcd(tmp, a[i])
print(tmp) from copy import deepcopy import math math import string string import collections collections from collections import Counter from collections import deque from decimal import Decimal import sys sys import fractions fractions from operator import itemgetter import itertools itertools import copy copy def readints():
    return list(map(int, input().split())) readints return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) nCr return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) math.factorial(n) math.factorial math factorial n math.factorial(n-r)*math.factorial(r) math.factorial(n-r) math.factorial math factorial n-r n r math.factorial(r) math.factorial math factorial r n n r r def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen) has_duplicates2 seen = [] seen [] for item in seq:
        if not(item in seen):
            seen.append(item)
     item seq if not(item in seen):
            seen.append(item)
     not(item in seen) item in seen item seen seen.append(item) seen.append seen append item return len(seq) != len(seen) len(seq) != len(seen) len(seq) len seq len(seen) len seen seq seq def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor divisor divisor = [] divisor [] for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
     i range(1, n+1) range 1 n+1 n 1 if n % i == 0:
            divisor.append(i)
     n % i == 0 n % i n i 0 divisor.append(i) divisor.append divisor append i return divisor divisor n n def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates gcd while(b != 0):
        a, b = b, a % b
     b != 0 b 0 a, b = b, a % b a b b a % b a b return a a a a b b dx = [-1, -1, -1, 0, 0, 1, 1, 1] dx [-1, -1, -1, 0, 0, 1, 1, 1] -1 -1 -1 0 0 1 1 1 dy = [-1, 0, 1, -1, 1, -1, 0, 1] dy [-1, 0, 1, -1, 1, -1, 0, 1] -1 0 1 -1 1 -1 0 1 n = int(input()) n int(input()) int input() input a = readints() a readints() readints tmp = gcd(0, a[0]) tmp gcd(0, a[0]) gcd 0 a[0] a 0 for i in range(1, n):
    tmp = gcd(tmp, a[i]) i range(1, n) range 1 n tmp = gcd(tmp, a[i]) tmp gcd(tmp, a[i]) gcd tmp a[i] a i print(tmp) print tmp def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) nCr tmp = gcd(tmp, a[i]) gcd(tmp, a[i]) tmp dy = [-1, 0, 1, -1, 1, -1, 0, 1] [-1, 0, 1, -1, 1, -1, 0, 1] dy def readints():
    return list(map(int, input().split())) def readints():
    return list(map(int, input().split())) readints def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor divisor a = readints() readints() a def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates gcd tmp = gcd(0, a[0]) gcd(0, a[0]) tmp def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen) def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen) has_duplicates2 n = int(input()) int(input()) n dx = [-1, -1, -1, 0, 0, 1, 1, 1] [-1, -1, -1, 0, 0, 1, 1, 1] dx
from copy import deepcopy
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools
import copy


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n = int(input())
a = readints()
# print(a)
tmp = gcd(0, a[0])
for i in range(1, n):
    tmp = gcd(tmp, a[i])
print(tmp)
