from math import gcd

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

g = A[0]

for i in A:
    g = gcd(g,i)

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

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

g = A[0]

for i in A:
    g = gcd(g,i)

print(g)
