n=int(input()) 
lis=list(map(int,input().split()))
m=min(lis)
new=lis
num=0
while True:
  for i in range(n+num):
    new[i]%=m
  if all(nn==0 for nn in new):
    print(m)
    exit()
  new.append(m)
  sl={m}
  for i in range(n+num):
    if new[i]!=0:
      sl.add(new[i])
  m=min(sl)
  num+=1 n=int(input()) n int(input()) int input() input lis=list(map(int,input().split())) lis list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split m=min(lis) m min(lis) min lis new=lis new lis num=0 num 0 while True:
  for i in range(n+num):
    new[i]%=m
  if all(nn==0 for nn in new):
    print(m)
    exit()
  new.append(m)
  sl={m}
  for i in range(n+num):
    if new[i]!=0:
      sl.add(new[i])
  m=min(sl)
  num+=1 True for i in range(n+num):
    new[i]%=m
   i range(n+num) range n+num n num new[i]%=m new[i] new i m if all(nn==0 for nn in new):
    print(m)
    exit()
   all(nn==0 for nn in new) all nn==0 nn 0 print(m) print m exit() exit new.append(m) new.append new append m sl={m} sl {m} for i in range(n+num):
    if new[i]!=0:
      sl.add(new[i])
   i range(n+num) range n+num n num if new[i]!=0:
      sl.add(new[i])
   new[i]!=0 new[i] new i 0 sl.add(new[i]) sl.add sl add new[i] new i m=min(sl) m min(sl) min sl num+=1 num 1 n=int(input()) int(input()) n m=min(sl) min(sl) m lis=list(map(int,input().split())) list(map(int,input().split())) lis sl={m} {m} sl num+=1 1 num m=min(lis) min(lis) m num=0 0 num new=lis lis new
n=int(input()) 
lis=list(map(int,input().split()))
m=min(lis)
new=lis
num=0
while True:
  for i in range(n+num):
    new[i]%=m
  if all(nn==0 for nn in new):
    print(m)
    exit()
  new.append(m)
  sl={m}
  for i in range(n+num):
    if new[i]!=0:
      sl.add(new[i])
  m=min(sl)
  num+=1