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