N,*A = map(int,open(0).read().split())
A.sort()
B = [[] for i in range(100)]
B[0]= A
#print(B)
for i in range(99):
  B[i+1].append(B[i][0])
  for j in range(1,len(B[i])):
    x = B[i][j]%B[i][0]
    if x!=0:
      B[i+1].append(x)
  B[i+1]=sorted(B[i+1])
  if len(B[i])<=1:
    break
print(B[i][0]) N,*A = map(int,open(0).read().split()) N map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *A A A.sort() A.sort A sort [] for i in range(100) for i in range(100) i range(100) range 100 for i in range(100) [] B = [[] for i in range(100)] B [[] for i in range(100)] B[0]= A B[0] B 0 A for i in range(99):
  B[i+1].append(B[i][0])
  for j in range(1,len(B[i])):
    x = B[i][j]%B[i][0]
    if x!=0:
      B[i+1].append(x)
  B[i+1]=sorted(B[i+1])
  if len(B[i])<=1:
    break i range(99) range 99 B[i+1].append(B[i][0]) [i+1].append [i+1] B i+1 i 1 append B[i][0] [i] B i 0 for j in range(1,len(B[i])):
    x = B[i][j]%B[i][0]
    if x!=0:
      B[i+1].append(x)
   j range(1,len(B[i])) range 1 len(B[i]) len B[i] B i x = B[i][j]%B[i][0] x B[i][j]%B[i][0] B[i][j] [i] B i j B[i][0] [i] B i 0 if x!=0:
      B[i+1].append(x)
   x!=0 x 0 B[i+1].append(x) [i+1].append [i+1] B i+1 i 1 append x B[i+1]=sorted(B[i+1]) B[i+1] B i+1 i 1 sorted(B[i+1]) sorted B[i+1] B i+1 i 1 if len(B[i])<=1:
    break len(B[i])<=1 len(B[i]) len B[i] B i 1 break print(B[i][0]) print B[i][0] [i] B i 0 N,*A = map(int,open(0).read().split()) map(int,open(0).read().split()) N B = [[] for i in range(100)] [[] for i in range(100)] B x = B[i][j]%B[i][0] B[i][j]%B[i][0] x
N,*A = map(int,open(0).read().split())
A.sort()
B = [[] for i in range(100)]
B[0]= A
#print(B)
for i in range(99):
  B[i+1].append(B[i][0])
  for j in range(1,len(B[i])):
    x = B[i][j]%B[i][0]
    if x!=0:
      B[i+1].append(x)
  B[i+1]=sorted(B[i+1])
  if len(B[i])<=1:
    break
print(B[i][0])