a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u)) a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split t , u = a[0],a[1] t a[0] a 0 u a[1] a 1 def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y) c if x % y:
    return(c(y,x%y))
  else:
    return(y) x % y x y return(c(y,x%y)) c(y,x%y) c y x%y x y return(y) y x x y y print(c(t,u)) print c(t,u) c t u t , u = a[0],a[1] a[0] t u = a[0],a[1] a[1] u def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y) def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y) c a = list(map(int, input().split())) list(map(int, input().split())) a
a = list(map(int, input().split()))
t , u = a[0],a[1]

def c(x,y):
  if x % y:
    return(c(y,x%y))
  else:
    return(y)

print(c(t,u))
