int a;input a;a=a*2;while a>1{if a mod 2>0{a=3*a+1;}else{a=a/2;}print a;}