def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
A = getList()

ans = A[0]
for i in range(1, N):
    ans = fractions.gcd(ans, A[i])
print(ans) def getN():
    return int(input()) getN return int(input()) int(input()) int input() input def getNM():
    return map(int, input().split()) getNM return map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split def getList():
    return list(map(int, input().split())) getList return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def getArray(intn):
    return [int(input()) for i in range(intn)] getArray int(input()) for i in range(intn) for i in range(intn) i range(intn) range intn for i in range(intn) int(input()) int input() input return [int(input()) for i in range(intn)] [int(input()) for i in range(intn)] intn intn def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip from collections import defaultdict, deque, Counter from sys import exit import heapq heapq import math math import fractions fractions import copy copy from operator import mul from functools import reduce from bisect import bisect_left, bisect_right import sys sys sys.setrecursionlimit(1000000000) sys.setrecursionlimit sys setrecursionlimit 1000000000 mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 N = getN() N getN() getN A = getList() A getList() getList ans = A[0] ans A[0] A 0 for i in range(1, N):
    ans = fractions.gcd(ans, A[i]) i range(1, N) range 1 N ans = fractions.gcd(ans, A[i]) ans fractions.gcd(ans, A[i]) fractions.gcd fractions gcd ans A[i] A i print(ans) print ans ans = A[0] A[0] ans N = getN() getN() N ans = fractions.gcd(ans, A[i]) fractions.gcd(ans, A[i]) ans def getList():
    return list(map(int, input().split())) def getList():
    return list(map(int, input().split())) getList A = getList() getList() A def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input def getN():
    return int(input()) def getN():
    return int(input()) getN def getArray(intn):
    return [int(input()) for i in range(intn)] def getArray(intn):
    return [int(input()) for i in range(intn)] getArray def getNM():
    return map(int, input().split()) def getNM():
    return map(int, input().split()) getNM mod = 10 ** 9 + 7 10 ** 9 + 7 mod
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import fractions
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N = getN()
A = getList()

ans = A[0]
for i in range(1, N):
    ans = fractions.gcd(ans, A[i])
print(ans)
