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