from fractions import gcd

n = int(input())
lis = list(map(int, input().split()))

tmp = gcd(lis[0], lis[1])

for i in range(1, n-1):
    tmp = gcd(tmp,lis[i+1])
    
print(tmp) from fractions import gcd n = int(input()) n int(input()) int input() input lis = list(map(int, input().split())) lis list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split tmp = gcd(lis[0], lis[1]) tmp gcd(lis[0], lis[1]) gcd lis[0] lis 0 lis[1] lis 1 for i in range(1, n-1):
    tmp = gcd(tmp,lis[i+1])
     i range(1, n-1) range 1 n-1 n 1 tmp = gcd(tmp,lis[i+1]) tmp gcd(tmp,lis[i+1]) gcd tmp lis[i+1] lis i+1 i 1 print(tmp) print tmp lis = list(map(int, input().split())) list(map(int, input().split())) lis n = int(input()) int(input()) n tmp = gcd(tmp,lis[i+1]) gcd(tmp,lis[i+1]) tmp tmp = gcd(lis[0], lis[1]) gcd(lis[0], lis[1]) tmp
from fractions import gcd

n = int(input())
lis = list(map(int, input().split()))

tmp = gcd(lis[0], lis[1])

for i in range(1, n-1):
    tmp = gcd(tmp,lis[i+1])
    
print(tmp)
