# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 17:37:26 2020

@author: liang
"""
N = int(input())
A = [int(x) for x in input().split()]

from math import gcd

A.sort()
g = A[0]
for i in range(1,N):
    g = gcd(g,A[i]) 
    #print(g)
print(g) """
Created on Mon Sep 14 17:37:26 2020

@author: liang
""" N = int(input()) N int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x A = [int(x) for x in input().split()] A [int(x) for x in input().split()] from math import gcd A.sort() A.sort A sort g = A[0] g A[0] A 0 for i in range(1,N):
    g = gcd(g,A[i]) 
    #print(g) i range(1,N) range 1 N g = gcd(g,A[i]) g gcd(g,A[i]) gcd g A[i] A i print(g) print g A = [int(x) for x in input().split()] [int(x) for x in input().split()] A N = int(input()) int(input()) N g = A[0] A[0] g g = gcd(g,A[i]) gcd(g,A[i]) g
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 17:37:26 2020

@author: liang
"""
N = int(input())
A = [int(x) for x in input().split()]

from math import gcd

A.sort()
g = A[0]
for i in range(1,N):
    g = gcd(g,A[i]) 
    #print(g)
print(g)