import math

n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(1,n):
    if i == 1:
        ans = math.gcd(a[0],a[i])
    else:
        ans = math.gcd(ans,a[i])

print(ans) 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 ans = 0 ans 0 for i in range(1,n):
    if i == 1:
        ans = math.gcd(a[0],a[i])
    else:
        ans = math.gcd(ans,a[i]) i range(1,n) range 1 n if i == 1:
        ans = math.gcd(a[0],a[i])
    else:
        ans = math.gcd(ans,a[i]) i == 1 i 1 ans = math.gcd(a[0],a[i]) ans math.gcd(a[0],a[i]) math.gcd math gcd a[0] a 0 a[i] a i ans = math.gcd(ans,a[i]) ans math.gcd(ans,a[i]) math.gcd math gcd ans a[i] a i print(ans) print ans ans = math.gcd(a[0],a[i]) math.gcd(a[0],a[i]) ans ans = math.gcd(ans,a[i]) math.gcd(ans,a[i]) ans n = int(input()) int(input()) n ans = 0 0 ans a = list(map(int,input().split())) list(map(int,input().split())) a
import math

n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(1,n):
    if i == 1:
        ans = math.gcd(a[0],a[i])
    else:
        ans = math.gcd(ans,a[i])

print(ans)
