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

A.sort()
while len(A) > 1:
    for i in range(1,len(A)):
        A[i] %= A[0]
    A = [x for x in A if x != 0]
    A.sort()

print(A[0]) 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 A.sort() A.sort A sort while len(A) > 1:
    for i in range(1,len(A)):
        A[i] %= A[0]
    A = [x for x in A if x != 0]
    A.sort() len(A) > 1 len(A) len A 1 for i in range(1,len(A)):
        A[i] %= A[0]
     i range(1,len(A)) range 1 len(A) len A A[i] %= A[0] A[i] A i A[0] A 0 x for x in A if x != 0 for x in A if x != 0 x A x != 0 x 0 if x != 0 x A = [x for x in A if x != 0] A [x for x in A if x != 0] A.sort() A.sort A sort print(A[0]) print A[0] A 0 A = list(map(int,input().split())) list(map(int,input().split())) A A = [x for x in A if x != 0] [x for x in A if x != 0] A N = int(input()) int(input()) N
N = int(input())
A = list(map(int,input().split()))

A.sort()
while len(A) > 1:
    for i in range(1,len(A)):
        A[i] %= A[0]
    A = [x for x in A if x != 0]
    A.sort()

print(A[0])