x, y = sorted([int(i) for i in input().split()])
while x > 0:
    z = x
    x = y % x
    y = z
    
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 = sorted([int(i) for i in input().split()]) x sorted([int(i) for i in input().split()]) sorted [int(i) for i in input().split()] y while x > 0:
    z = x
    x = y % x
    y = z
     x > 0 x 0 z = x z x x = y % x x y % x y x y = z y z print(y) print y x = y % x y % x x x, y = sorted([int(i) for i in input().split()]) sorted([int(i) for i in input().split()]) x y = z z y z = x x z y = sorted([int(i) for i in input().split()]) sorted([int(i) for i in input().split()]) y
x, y = sorted([int(i) for i in input().split()])
while x > 0:
    z = x
    x = y % x
    y = z
    
print(y)