# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

sys.setrecursionlimit(10**6)
def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N = z()
A = zz()
# A = sorted(A)
tmp =gcd(A[0], A[1])
for a in A[1:]:
    tmp = gcd(tmp, a)
ans = tmp
# for i in range(N):
#     for j in range(0, i):        
#         tmp = A[i] % A[j]
#         tmp = min(tmp, A[j]-tmp)
#         if (tmp != 0):
#             ans = min(ans, tmp)
print(ans)
             import numpy as np numpy import sys sys from collections import deque from collections import defaultdict import heapq heapq import collections collections import itertools itertools import bisect bisect sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 def zz():
    return list(map(int, sys.stdin.readline().split())) zz return list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def z():
    return int(sys.stdin.readline()) z return int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def S():
    return sys.stdin.readline() S return sys.stdin.readline() sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def C(line):
    return [sys.stdin.readline() for _ in range(line)] C sys.stdin.readline() for _ in range(line) for _ in range(line) _ range(line) range line for _ in range(line) sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline return [sys.stdin.readline() for _ in range(line)] [sys.stdin.readline() for _ in range(line)] line line def gcd(a, b):
    while b:
        a, b = b, a % b
    return a gcd while b:
        a, b = b, a % b
     b a, b = b, a % b a b b a % b a b return a a a a b b N = z() N z() z A = zz() A zz() zz tmp =gcd(A[0], A[1]) tmp gcd(A[0], A[1]) gcd A[0] A 0 A[1] A 1 for a in A[1:]:
    tmp = gcd(tmp, a) a A[1:] A 1: 1 tmp = gcd(tmp, a) tmp gcd(tmp, a) gcd tmp a ans = tmp ans tmp print(ans) print ans def zz():
    return list(map(int, sys.stdin.readline().split())) def zz():
    return list(map(int, sys.stdin.readline().split())) zz def S():
    return sys.stdin.readline() def S():
    return sys.stdin.readline() S N = z() z() N A = zz() zz() A ans = tmp tmp ans tmp =gcd(A[0], A[1]) gcd(A[0], A[1]) tmp def C(line):
    return [sys.stdin.readline() for _ in range(line)] def C(line):
    return [sys.stdin.readline() for _ in range(line)] C tmp = gcd(tmp, a) gcd(tmp, a) tmp def z():
    return int(sys.stdin.readline()) def z():
    return int(sys.stdin.readline()) z def gcd(a, b):
    while b:
        a, b = b, a % b
    return a def gcd(a, b):
    while b:
        a, b = b, a % b
    return a gcd
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

sys.setrecursionlimit(10**6)
def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


def S():
    return sys.stdin.readline()


def C(line):
    return [sys.stdin.readline() for _ in range(line)]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N = z()
A = zz()
# A = sorted(A)
tmp =gcd(A[0], A[1])
for a in A[1:]:
    tmp = gcd(tmp, a)
ans = tmp
# for i in range(N):
#     for j in range(0, i):        
#         tmp = A[i] % A[j]
#         tmp = min(tmp, A[j]-tmp)
#         if (tmp != 0):
#             ans = min(ans, tmp)
print(ans)
            
