n = int(input())
A = list(set(list(map(int, input().split()))))
A.sort()

while not len(A) == 1:
    div = A[0]
    A = A[1:]
    A = list(map(lambda x:x%div, A))
    A.append(div)
    A = list(set([x for x in A if x != 0]))
    A.sort()

print(A[0]) n = int(input()) n int(input()) int input() input A = list(set(list(map(int, input().split())))) A list(set(list(map(int, input().split())))) list set(list(map(int, input().split()))) set list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A.sort() A.sort A sort while not len(A) == 1:
    div = A[0]
    A = A[1:]
    A = list(map(lambda x:x%div, A))
    A.append(div)
    A = list(set([x for x in A if x != 0]))
    A.sort() not len(A) == 1 len(A) == 1 len(A) len A 1 div = A[0] div A[0] A 0 A = A[1:] A A[1:] A 1: 1 A = list(map(lambda x:x%div, A)) A list(map(lambda x:x%div, A)) list map(lambda x:x%div, A) map lambda x:x%div x%div x div x A A.append(div) A.append A append div 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 = list(set([x for x in A if x != 0])) A list(set([x for x in A if x != 0])) list set([x for x in A if x != 0]) set [x for x in A if x != 0] A.sort() A.sort A sort print(A[0]) print A[0] A 0 div = A[0] A[0] div A = list(set(list(map(int, input().split())))) list(set(list(map(int, input().split())))) A A = list(map(lambda x:x%div, A)) list(map(lambda x:x%div, A)) A A = A[1:] A[1:] A A = list(set([x for x in A if x != 0])) list(set([x for x in A if x != 0])) A n = int(input()) int(input()) n
n = int(input())
A = list(set(list(map(int, input().split()))))
A.sort()

while not len(A) == 1:
    div = A[0]
    A = A[1:]
    A = list(map(lambda x:x%div, A))
    A.append(div)
    A = list(set([x for x in A if x != 0]))
    A.sort()

print(A[0])