from fractions import gcd
n = int(input())
a_input = list(map(int,input().split()))

x = a_input.pop(0)
for i in range(len(a_input)):
    x = gcd(x,a_input[i])
print(x) from fractions import gcd n = int(input()) n int(input()) int input() input a_input = list(map(int,input().split())) a_input list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split x = a_input.pop(0) x a_input.pop(0) a_input.pop a_input pop 0 for i in range(len(a_input)):
    x = gcd(x,a_input[i]) i range(len(a_input)) range len(a_input) len a_input x = gcd(x,a_input[i]) x gcd(x,a_input[i]) gcd x a_input[i] a_input i print(x) print x a_input = list(map(int,input().split())) list(map(int,input().split())) a_input n = int(input()) int(input()) n x = gcd(x,a_input[i]) gcd(x,a_input[i]) x x = a_input.pop(0) a_input.pop(0) x
from fractions import gcd
n = int(input())
a_input = list(map(int,input().split()))

x = a_input.pop(0)
for i in range(len(a_input)):
    x = gcd(x,a_input[i])
print(x)