import math
n = int(input())
A = tuple(map(int, input().split()))
g = A[0]
for a in A[1:]:
    g = math.gcd(g, a)
print(g) import math math n = int(input()) n int(input()) int input() input A = tuple(map(int, input().split())) A tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split g = A[0] g A[0] A 0 for a in A[1:]:
    g = math.gcd(g, a) a A[1:] A 1: 1 g = math.gcd(g, a) g math.gcd(g, a) math.gcd math gcd g a print(g) print g n = int(input()) int(input()) n A = tuple(map(int, input().split())) tuple(map(int, input().split())) A g = math.gcd(g, a) math.gcd(g, a) g g = A[0] A[0] g
import math
n = int(input())
A = tuple(map(int, input().split()))
g = A[0]
for a in A[1:]:
    g = math.gcd(g, a)
print(g)
