# author:  Taichicchi
# created: 14.09.2020 22:18:44

import sys
from math import gcd

N = int(input())

A = list(map(int, input().split()))

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

print(ans) import sys sys from math import gcd 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 ans = gcd(A[0], A[1]) ans gcd(A[0], A[1]) gcd A[0] A 0 A[1] A 1 for i in range(2, N):
    ans = gcd(ans, A[i]) i range(2, N) range 2 N ans = gcd(ans, A[i]) ans gcd(ans, A[i]) gcd ans A[i] A i print(ans) print ans A = list(map(int, input().split())) list(map(int, input().split())) A ans = gcd(ans, A[i]) gcd(ans, A[i]) ans N = int(input()) int(input()) N ans = gcd(A[0], A[1]) gcd(A[0], A[1]) ans
# author:  Taichicchi
# created: 14.09.2020 22:18:44

import sys
from math import gcd

N = int(input())

A = list(map(int, input().split()))

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

print(ans)
