m=input() n=input() while n != 0: m, n = n, m % n print(m)
------Input------ 234 396 ------Answer----- 18 ------Your output-----