n = int(input())
min_ = 0
list_ = set(list(map(int, input().split())))

while True:
  tmp = min(list_)
  list_ = set([i%tmp for i in list_])
  if 0 in list_:
    list_.remove(0)
  list_.add(tmp)
  if tmp==min(list_):
    break
print(tmp) n = int(input()) n int(input()) int input() input min_ = 0 min_ 0 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 while True:
  tmp = min(list_)
  list_ = set([i%tmp for i in list_])
  if 0 in list_:
    list_.remove(0)
  list_.add(tmp)
  if tmp==min(list_):
    break True tmp = min(list_) tmp min(list_) min list_ i%tmp for i in list_ for i in list_ i list_ for i in list_ i%tmp i tmp list_ = set([i%tmp for i in list_]) list_ set([i%tmp for i in list_]) set [i%tmp for i in list_] if 0 in list_:
    list_.remove(0)
   0 in list_ 0 list_ list_.remove(0) list_.remove list_ remove 0 list_.add(tmp) list_.add list_ add tmp if tmp==min(list_):
    break tmp==min(list_) tmp min(list_) min list_ break print(tmp) print tmp n = int(input()) int(input()) n tmp = min(list_) min(list_) tmp list_ = set(list(map(int, input().split()))) set(list(map(int, input().split()))) list_ list_ = set([i%tmp for i in list_]) set([i%tmp for i in list_]) list_ min_ = 0 0 min_
n = int(input())
min_ = 0
list_ = set(list(map(int, input().split())))

while True:
  tmp = min(list_)
  list_ = set([i%tmp for i in list_])
  if 0 in list_:
    list_.remove(0)
  list_.add(tmp)
  if tmp==min(list_):
    break
print(tmp)