using System; using System.Linq; using System.Collections.Generic; class Program { static void Main(string[] args) { int[] a = Console.ReadLine().Split().Select(b => int.Parse(b)).ToArray(); int[] card = new int[13]; string output = "NO HAND"; for (int i = 0; i < 5; i++) { card[a[i]]++; } while (true) { if (Array.IndexOf(card, 3) > 0) { if (Array.IndexOf(card, 2) > 0) { output = "FULL HOUSE"; break; } else { output = "THREE CARD"; break; } } if (Array.IndexOf(card, 2) > 0) { card[Array.IndexOf(card, 2)] = 0; if (Array.IndexOf(card, 2) > 0) { output = "TWO PAIR"; break; } else { output = "ONE PAIR"; break; } } break; } Console.WriteLine(output); Console.Read(); } }