import math
N = int(input())
A = list(map(int, input().split()))

g = A[0]

for i in range(1, N):
	g = math.gcd(g, A[i])
	
print(g) 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 g = A[0] g A[0] A 0 for i in range(1, N):
	g = math.gcd(g, A[i])
	 i range(1, N) range 1 N g = math.gcd(g, A[i]) g math.gcd(g, A[i]) math.gcd math gcd g A[i] A i print(g) print g A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N g = math.gcd(g, A[i]) math.gcd(g, A[i]) g g = A[0] A[0] g
import math
N = int(input())
A = list(map(int, input().split()))

g = A[0]

for i in range(1, N):
	g = math.gcd(g, A[i])
	
print(g)