using System; using System.Collections.Generic; using System.Linq; namespace yukicode { public class Program { public static string Solver(System.IO.TextReader reader) { var cards = reader.ReadLine().Split( ' ' ); var map = new Dictionary(); foreach (var i in cards) { if (map.ContainsKey( i )) { map[ i ] += 1; } else { map.Add( i, 1 ); } } if (map.ContainsValue( 3 )) { if (map.ContainsValue( 2 )) { return "FULL HOUSE"; } else { return "THREE CARD"; } } else if (map.ContainsValue( 2 )) { if (map.Count == 3) { return "TWO PAIR"; } else if (map.Count == 4) { return "ONE PAIR"; } } return "NO HAND"; } private static void Main() { Console.WriteLine( Solver( Console.In ) ); } } //--- MyLib --- public class MyLib { public static string Ordinalization(int num) { string[] surfix = { "st", "nd", "rd", "th" }; return string.Format( "{0}{1}", num, 0 < num % 10 && num % 10 <= 4 ? surfix[ num % 10 - 1 ] : surfix[ 3 ] ); } public static List GetIntListFromTextReader(System.IO.TextReader reader, char delimitor) { return reader.ReadLine().Split( delimitor ).ToList().ConvertAll( int.Parse ); } public static List GetIntListFromTextReader(System.IO.TextReader reader, char[] delimitors) { return reader.ReadLine().Split( delimitors ).ToList().ConvertAll( int.Parse ); } } }