from fractions import gcd

N = int(input())
As = list(map(int, input().split()))

rlt = As[0]

for a in As[1:]:
  rlt = gcd(a,rlt)
  
print(rlt) from fractions import gcd N = int(input()) N int(input()) int input() input As = list(map(int, input().split())) As list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split rlt = As[0] rlt As[0] As 0 for a in As[1:]:
  rlt = gcd(a,rlt)
   a As[1:] As 1: 1 rlt = gcd(a,rlt) rlt gcd(a,rlt) gcd a rlt print(rlt) print rlt rlt = As[0] As[0] rlt N = int(input()) int(input()) N rlt = gcd(a,rlt) gcd(a,rlt) rlt As = list(map(int, input().split())) list(map(int, input().split())) As
from fractions import gcd

N = int(input())
As = list(map(int, input().split()))

rlt = As[0]

for a in As[1:]:
  rlt = gcd(a,rlt)
  
print(rlt)