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)
  7.  
  8.  
Success #stdin #stdout 0.1s 14056KB
stdin
40
24
stdout
8