using System.Collections.Generic; using System; using System.Linq; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { var A = Console.ReadLine(); var b = A.Split(" "); string[] str = new string[b.Length]; List Hit = new List(); List twopair = new List(); for (int i = 0; i < str.Length; i++) { str[i] = b[i]; } Array.Sort(str); for(int i = 0; i <= str.Length - 4; i++) { for (int j = 1 + i; j <= str.Length - 3; j++) { if (str[i] == str[j]) { Hit.Add(str[i]); } } } for (int i = 2; i <= str.Length - 2; i++) { for (int j = 2 + i-1; j <= str.Length - 1 ; j++) { if (str[i] == str[j]) { twopair.Add(str[i]); } } } if (Hit.Count == 3 && twopair.Count == 1 || twopair.Count == 3 && Hit.Count == 1) { Console.WriteLine("FULL HOUSE"); } else if (Hit.Count == 3 && twopair.Count == 0 || twopair.Count == 3 && Hit.Count == 0) { Console.WriteLine("THREE CARD"); } else if (Hit.Count == 1 && twopair.Count == 1 ) { Console.WriteLine("TWO PAIR"); } else if (Hit.Count == 1 && twopair.Count == 0 || twopair.Count == 1 && Hit.Count == 0) { Console.WriteLine("ONE PAIR"); } else { Console.WriteLine("NO HAND"); } } } }