# Computes the GCD of two positive integers

# Get the first integer
a = int(raw_input("Enter first positive integer: "))

# Get the second integer
b = int(raw_input("Enter second positive integer: "))

# While the two integers are not equal
while a != b :
    # if a is greater than b, subtract b from a
    if a > b:
        a = a - b
    # if b is greater than a, subtract a from b
    else :
        b = b - a 
print "Greatest common divisor is", a