s = input().split()
A = int(s[0])
B = int(s[1])

if A < B:
  v = B
  B = A
  A = v

R = A % B
while R !=0:
  A = B
  B = R
  R = A % B
print(B) s = input().split() s input().split() ().split () input split A = int(s[0]) A int(s[0]) int s[0] s 0 B = int(s[1]) B int(s[1]) int s[1] s 1 if A < B:
  v = B
  B = A
  A = v A < B A B v = B v B B = A B A A = v A v R = A % B R A % B A B while R !=0:
  A = B
  B = R
  R = A % B R !=0 R 0 A = B A B B = R B R R = A % B R A % B A B print(B) print B B = int(s[1]) int(s[1]) B A = int(s[0]) int(s[0]) A B = R R B A = v v A A = B B A R = A % B A % B R R = A % B A % B R s = input().split() input().split() s v = B B v B = A A B
s = input().split()
A = int(s[0])
B = int(s[1])

if A < B:
  v = B
  B = A
  A = v

R = A % B
while R !=0:
  A = B
  B = R
  R = A % B
print(B)
