n=int(input())
A=list(map(int,input().split()))
x=min(A)
noend=True
while noend:
  a=x
  for i in range(n):
    if A[i]%x!=0 and A[i]%x<x:
      x=A[i]%x
      break
  if x==a:
    noend=False
print(x)
      