using C=System.Console;class X{static void Main(){for(;;)C.Write("1{0}4{0}6{0}4{0}1\n",C.ReadLine().Trim('1'));}}