var a,b:comp;begin read(a);repeat writeln(a);b:=a mod 2;a:=a div 2*(1-b)+b*(3*a+1)until a<2;write(a)end.