n = int(input())
lst = list(map(int, input().split()))
for i in range(n - 1):
  a, b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) # a < b
  while a != 0:
    a, b = b % a, a
  lst[i + 1] = b
print(lst[n - 1]) n = int(input()) n int(input()) int input() input lst = list(map(int, input().split())) lst list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for i in range(n - 1):
  a, b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) # a < b
  while a != 0:
    a, b = b % a, a
  lst[i + 1] = b i range(n - 1) range n - 1 n 1 a, b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) a min(lst[i], lst[i + 1]) min lst[i] lst i lst[i + 1] lst i + 1 i 1 b max(lst[i], lst[i + 1]) max lst[i] lst i lst[i + 1] lst i + 1 i 1 while a != 0:
    a, b = b % a, a
   a != 0 a 0 a, b = b % a, a a b % a b a b a lst[i + 1] = b lst[i + 1] lst i + 1 i 1 b print(lst[n - 1]) print lst[n - 1] lst n - 1 n 1 b = b % a, a a b lst = list(map(int, input().split())) list(map(int, input().split())) lst a, b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) min(lst[i], lst[i + 1]) a a, b = b % a, a b % a a b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) max(lst[i], lst[i + 1]) b n = int(input()) int(input()) n
n = int(input())
lst = list(map(int, input().split()))
for i in range(n - 1):
  a, b = min(lst[i], lst[i + 1]), max(lst[i], lst[i + 1]) # a < b
  while a != 0:
    a, b = b % a, a
  lst[i + 1] = b
print(lst[n - 1])