n = int(input())
A = list(map(int, input().split()))
A.sort()
while len(A) > 1:
  a = [A[0]]
  for i in range(1, len(A)):
    if A[i]%A[0] == 0: continue
    else: a.append(A[i]%A[0])
  A = sorted(a)
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:
  a = [A[0]]
  for i in range(1, len(A)):
    if A[i]%A[0] == 0: continue
    else: a.append(A[i]%A[0])
  A = sorted(a) len(A) > 1 len(A) len A 1 a = [A[0]] a [A[0]] A[0] A 0 for i in range(1, len(A)):
    if A[i]%A[0] == 0: continue
    else: a.append(A[i]%A[0])
   i range(1, len(A)) range 1 len(A) len A if A[i]%A[0] == 0: continue
    else: a.append(A[i]%A[0])
   A[i]%A[0] == 0 A[i]%A[0] A[i] A i A[0] A 0 0 A = sorted(a) A sorted(a) sorted a print(A[0]) print A[0] A 0 A = sorted(a) sorted(a) A A = list(map(int, input().split())) list(map(int, input().split())) A n = int(input()) int(input()) n a = [A[0]] [A[0]] a
n = int(input())
A = list(map(int, input().split()))
A.sort()
while len(A) > 1:
  a = [A[0]]
  for i in range(1, len(A)):
    if A[i]%A[0] == 0: continue
    else: a.append(A[i]%A[0])
  A = sorted(a)
print(A[0])