#include using namespace std; template long long len_arr(vector& A) { long long ans = 0; for (T x : A) { ans++; } return ans; } int main() { long long N, M; cin >> N >> M; assert(1 <= N && N <= 1000000000); assert(1 <= M && M <= 1000000000); vectorA; A.push_back(N / M); while (N % M != 0) { long long num = N % M; N = M; M = num; A.push_back(N / M); } for (long long i = 0; i < len_arr(A); i++) { if (i != 0) cout << ' '; cout << A[i]; } cout << endl; }