import math
n = int(input())
a = list(map(int, input().split()))

gcd = a[0]
for i in range(1, n):
    gcd = math.gcd(a[i], gcd)
    if gcd == 1:
        print(1)
        break
else:
    print(gcd) 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 gcd = a[0] gcd a[0] a 0 for i in range(1, n):
    gcd = math.gcd(a[i], gcd)
    if gcd == 1:
        print(1)
        break
else:
    print(gcd) i range(1, n) range 1 n gcd = math.gcd(a[i], gcd) gcd math.gcd(a[i], gcd) math.gcd math gcd a[i] a i gcd if gcd == 1:
        print(1)
        break gcd == 1 gcd 1 print(1) print 1 break print(gcd) print gcd gcd = a[0] a[0] gcd gcd = math.gcd(a[i], gcd) math.gcd(a[i], gcd) gcd n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a
import math
n = int(input())
a = list(map(int, input().split()))

gcd = a[0]
for i in range(1, n):
    gcd = math.gcd(a[i], gcd)
    if gcd == 1:
        print(1)
        break
else:
    print(gcd)