ans = [] def gcd(x, y): if y == 0: return x else: ans.append(x // y) return gcd(y, x % y) n, m = map(int, input().split()) _ = gcd(n, m) print(*ans, sep=" ")