import math
N = int(input())
A = sorted([int(X) for X in input().split()])
GCDA = A[0]
for T in range(1,N):
    GCDA = math.gcd(GCDA,A[T])
    if GCDA==1: break
print(GCDA) import math math N = int(input()) N int(input()) int input() input int(X) for X in input().split() for X in input().split() X input().split() ().split () input split for X in input().split() int(X) int X A = sorted([int(X) for X in input().split()]) A sorted([int(X) for X in input().split()]) sorted [int(X) for X in input().split()] GCDA = A[0] GCDA A[0] A 0 for T in range(1,N):
    GCDA = math.gcd(GCDA,A[T])
    if GCDA==1: break T range(1,N) range 1 N GCDA = math.gcd(GCDA,A[T]) GCDA math.gcd(GCDA,A[T]) math.gcd math gcd GCDA A[T] A T if GCDA==1: b GCDA==1 GCDA 1 print(GCDA) print GCDA GCDA = math.gcd(GCDA,A[T]) math.gcd(GCDA,A[T]) GCDA N = int(input()) int(input()) N A = sorted([int(X) for X in input().split()]) sorted([int(X) for X in input().split()]) A GCDA = A[0] A[0] GCDA
import math
N = int(input())
A = sorted([int(X) for X in input().split()])
GCDA = A[0]
for T in range(1,N):
    GCDA = math.gcd(GCDA,A[T])
    if GCDA==1: break
print(GCDA)