import sys
import math


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



g = A.pop(0)
for c in A:
    g = math.gcd(g,c)

print(g) import sys sys 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 g = A.pop(0) g A.pop(0) A.pop A pop 0 for c in A:
    g = math.gcd(g,c) c A g = math.gcd(g,c) g math.gcd(g,c) math.gcd math gcd g c print(g) print g g = A.pop(0) A.pop(0) g A = list(map(int, input().split())) list(map(int, input().split())) A N = int(input()) int(input()) N g = math.gcd(g,c) math.gcd(g,c) g
import sys
import math


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



g = A.pop(0)
for c in A:
    g = math.gcd(g,c)

print(g)