using C=System.Console;class X{static void Main(){var s=C.In.ReadToEnd().Split('\n');foreach(var c in"ABCDFGJKLNOPQRSTUVW")C.WriteLine(s[c-65]);}}