using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Numerics; using System.Globalization; namespace foryuki { class Program { static int[] n; static void Main(string[] args) { var a = ConvertStringArrayToIntArray(Console.ReadLine().Split()); Array.Sort(a); if ((a[0] == a[1] && a[0] == a[2] && a[3] == a[4]) || (a[0] == a[1] && a[2] == a[3] && a[2] == a[4])) { Console.WriteLine("FULL HOUSE"); return; } for (int i = 0; i < 5; i++) { if (a.Where(x => x == a[i]).Count() == 3) { Console.WriteLine("THREE CARD"); return; } } if (a[0] == a[1] && a[2] == a[3] || a[1] == a[2] && a[3] == a[4] || a[0] == a[1] && a[3] == a[4]) { Console.WriteLine("TWO PAIR"); return; } for (int i = 0; i < 5; i++) { if (a.Where(x => x == a[i]).Count() == 1) { Console.WriteLine("ONE PAIR"); return; } } Console.WriteLine("NO HAND"); Console.ReadLine(); } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] array) { return Array.ConvertAll(array, str => int.Parse(str)); } static List ConvertStringArrayToIntList(string[] str) { var list = new List(); foreach (var c in str) { list.Add(int.Parse(c)); } return list; } } }