class A{static void Main(){var a=new int[105];for(int n=0;;)System.Console.WriteLine(a[n]=n%2+3*a[n++/2]);}}