n=$0;{for(;1-n;)print n=n%2?3*n+1:n/2}