N, M = list(map(int, input().split())) A = N B = M ans = [] while B != 0 : Q = int(A / B) ans.append(Q) C = A - B * Q A = B B = C print(*ans)