import fractions

N=int(input())
A=list(map(int, input().split()))
gcdans=A[0]
for i in range(1,N):
	gcdans=fractions.gcd(gcdans,A[i])

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

N=int(input())
A=list(map(int, input().split()))
gcdans=A[0]
for i in range(1,N):
	gcdans=fractions.gcd(gcdans,A[i])

print(gcdans)
