n, m = map(int, input().split()) nums = [] while m != 0: nums.append(n//m) n, m = m, n%m print(*nums)