#include <stdio.h>

int main(int argc, char** argv) {

    int n = 19;

    while (n > 1) {
        printf("%d\n", n);

        if (n % 2 == 0) { // n even
            n = n/2;
        } else { // n odd
            n = 3*n+1;
        }
    }

    // n is now 1
    // We just print that to make it pretty in the output.
    printf("1\n");

    return 0;
}
