import numpy as np
N = int(input())
A = list(map(int,input().split()))
print(np.gcd.reduce(A)) import numpy as np numpy 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 print(np.gcd.reduce(A)) print np.gcd.reduce(A) np.gcd.reduce np.gcd np gcd reduce A A = list(map(int,input().split())) list(map(int,input().split())) A N = int(input()) int(input()) N
import numpy as np
N = int(input())
A = list(map(int,input().split()))
print(np.gcd.reduce(A))