import math
n=int(input())
a=list(map(int,input().split()))
num=a[0]
def g(num1,num2):
    return math.gcd(num1,num2)
for i in range(n-1):
    num=g(num,a[i+1])
print(num) import math math n=int(input()) n int(input()) int input() input a=list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split num=a[0] num a[0] a 0 def g(num1,num2):
    return math.gcd(num1,num2) g return math.gcd(num1,num2) math.gcd(num1,num2) math.gcd math gcd num1 num2 num1 num1 num2 num2 for i in range(n-1):
    num=g(num,a[i+1]) i range(n-1) range n-1 n 1 num=g(num,a[i+1]) num g(num,a[i+1]) g num a[i+1] a i+1 i 1 print(num) print num def g(num1,num2):
    return math.gcd(num1,num2) def g(num1,num2):
    return math.gcd(num1,num2) g n=int(input()) int(input()) n num=a[0] a[0] num a=list(map(int,input().split())) list(map(int,input().split())) a num=g(num,a[i+1]) g(num,a[i+1]) num
import math
n=int(input())
a=list(map(int,input().split()))
num=a[0]
def g(num1,num2):
    return math.gcd(num1,num2)
for i in range(n-1):
    num=g(num,a[i+1])
print(num)
