using System; using System.Linq; namespace No227{ public class Program{ //しらゆきさんの解法が面白かったのでパクっ(参考にし)た //http://yukicoder.me/submissions/59675 public static void Main(string[] args){ var hands = new[]{"NO HAND", "ONE PAIR", "TWO PAIR", "THREE CARD", "FULL HOUSE"}; var card = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse).OrderBy(x => x).ToArray(); var res = 0; for(var i = 0; i < 5; i++){ for(var j = i + 1; j < 5; j++){ if(card[i] == card[j]) res++; } } try{ Console.WriteLine(hands[res]); } catch(Exception){ Console.WriteLine(hands[0]); } } } }