import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate
from fractions import gcd

def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans)

if __name__ == '__main__':
    solve() import sys sys sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 def int1(x): return int(x) - 1 int1 x x def II(): return int(input()) II def MI(): return map(int, input().split()) MI def MI1(): return map(int1, input().split()) MI1 def LI(): return list(map(int, input().split())) LI def LI1(): return list(map(int1, input().split())) LI1 LI() for _ in range(rows_number) for _ in range(rows_number) _ range(rows_number) range rows_number for _ in range(rows_number) LI() LI def LLI(rows_number): return [LI() for _ in range(rows_number)] LLI rows_number rows_number def MS(): return input().split() MS def LS(): return list(input()) LS LS() for _ in range(rows_number) for _ in range(rows_number) _ range(rows_number) range rows_number for _ in range(rows_number) LS() LS def LLS(rows_number): return [LS() for _ in range(rows_number)] LLS rows_number rows_number def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) printlist lst lst k=' ' k ' ' INF = float('inf') INF float('inf') float 'inf' from fractions import gcd def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans) solve N = II() N II() II A = LI() A LI() LI ans = A[0] ans A[0] A 0 for a in A:
        ans = gcd(ans, a)
     a A ans = gcd(ans, a) ans gcd(ans, a) gcd ans a print(ans) print ans if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def LLS(rows_number): return [LS() for _ in range(rows_number)] def LLS(rows_number): return [LS() for _ in range(rows_number)] LLS INF = float('inf') float('inf') INF def int1(x): return int(x) - 1 def int1(x): return int(x) - 1 int1 def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI def LS(): return list(input()) def LS(): return list(input()) LS def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) def printlist(lst, k=' '): print(k.join(list(map(str, lst)))) printlist def MS(): return input().split() def MS(): return input().split() MS def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI(rows_number): return [LI() for _ in range(rows_number)] LLI def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def II(): return int(input()) def II(): return int(input()) II def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans) def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans) solve def LI1(): return list(map(int1, input().split())) def LI1(): return list(map(int1, input().split())) LI1 def MI1(): return map(int1, input().split()) def MI1(): return map(int1, input().split()) MI1
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate
from fractions import gcd

def solve():
    N = II()
    A = LI()

    ans = A[0]
    for a in A:
        ans = gcd(ans, a)
    print(ans)

if __name__ == '__main__':
    solve()
