#include <bits/stdc++.h> using namespace std;
long long a[110], x; int n;
int main() { cin >> n; while (n != 1) { a[++x] = n; if (n / 2 != 0) { n * 3 + 1; } if (n / 2 == 0) { n / 2; } } a[++x] = 1; for (int i = x; i > 1; i--) { cout << a[i] << ' '; cout << endl; } return 0; }