x, y = [ int(i) for i in input().split()]

if x > y:
    x, y = y, x

while True:
    if x % y:
        x, y = y, x % y
        continue
    break

print(y) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i x, y = [ int(i) for i in input().split()] x [ int(i) for i in input().split()] y if x > y:
    x, y = y, x x > y x y x, y = y, x x y y x while True:
    if x % y:
        x, y = y, x % y
        continue
    break True if x % y:
        x, y = y, x % y
        continue
     x % y x y x, y = y, x % y x y y x % y x y continue break print(y) print y x, y = y, x % y y x x, y = y, x y x y = y, x % y x % y y y = [ int(i) for i in input().split()] [ int(i) for i in input().split()] y y = y, x x y x, y = [ int(i) for i in input().split()] [ int(i) for i in input().split()] x
x, y = [ int(i) for i in input().split()]

if x > y:
    x, y = y, x

while True:
    if x % y:
        x, y = y, x % y
        continue
    break

print(y)
