using System; using System.Collections.Generic; using System.Linq; namespace No227 { class MainClass { public static void Main (string[] args) { var cards = Console.ReadLine ().Split (' ').Select (v => Convert.ToInt32 (v)).ToArray (); var dictionary = new Dictionary (); foreach (var element in cards) { if (!dictionary.ContainsKey (element)) { dictionary.Add (element, 0); } dictionary [element]++; } if (dictionary.Any (element => element.Value == 3)) { if (dictionary.Any (element => element.Value == 2)) { Console.WriteLine ("FULL HOUSE"); return; } Console.WriteLine ("THREE CARD"); return; } if (dictionary.Any (element => element.Value == 2)) { if (dictionary.Count() == 3) { Console.WriteLine ("TWO PAIR"); return; } Console.WriteLine ("ONE PAIR"); return; } Console.WriteLine ("NO HAND"); } } }