N,M=map(int,input().split()) A=[] while True: A.append(N//M) N=N%M N,M=M,N if M==0: break print(*A)