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

A.sort()
stack = A[1:]
m = A[0]

while stack:
  stack = list(stack)
  l = []
  for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
  if not l:
    break
  l.append(m)
  m = min(l)
  stack = set(l)

print(m) 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 stack = A[1:] stack A[1:] A 1: 1 m = A[0] m A[0] A 0 while stack:
  stack = list(stack)
  l = []
  for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
  if not l:
    break
  l.append(m)
  m = min(l)
  stack = set(l) stack stack = list(stack) stack list(stack) list stack l = [] l [] for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
   x stack if x % m == 0:
      continue
     x % m == 0 x % m x m 0 continue l.append(x % m) l.append l append x % m x m if not l:
    break
   not l l break l.append(m) l.append l append m m = min(l) m min(l) min l stack = set(l) stack set(l) set l print(m) print m N = int(input()) int(input()) N A = list(map(int,input().split())) list(map(int,input().split())) A stack = set(l) set(l) stack l = [] [] l stack = A[1:] A[1:] stack m = min(l) min(l) m stack = list(stack) list(stack) stack m = A[0] A[0] m
N = int(input())
A = list(map(int,input().split()))

A.sort()
stack = A[1:]
m = A[0]

while stack:
  stack = list(stack)
  l = []
  for x in stack:
    if x % m == 0:
      continue
    l.append(x % m)
  
  if not l:
    break
  l.append(m)
  m = min(l)
  stack = set(l)

print(m)
