fork download
  1. x=int(input())
  2. y=int(input())
  3. while x!=y:
  4. if x>y: x=x-y
  5. else: y=y-x
  6. print(x)
Success #stdin #stdout 0.09s 14096KB
stdin
40
28
stdout
4