using System; using System.Diagnostics; namespace yukicoder { class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(' '); int[] a = new int[5]; //数字比較用配列 int[] c = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; //入力した数字を配列に入れる for (int i = 0; i < 5; i++) { int A = int.Parse(str[i]); a[i] = A; } //数字がいくつあるか調べる あればカウント+1する int count = 0; for(int i=1;i<=13;i++) { for(int j=1;j<=5;j++) { if(a[j-1]==i) { count += 1; c[i - 1] += 1; } } } int count1 = 0; //配列に2か3以外のカウントが入っているなら0にする //1が入っているならプラス1する for (int i = 1; i <= 13; i++) { if (c[i - 1] == 1) { count1 += 1; c[i - 1] = 0; } if (c[i - 1] == 5 || c[i - 1] == 4) { count = 0; break; } } int ans = count - count1; if (ans == 5) { Console.WriteLine("FULL HOUSE"); } else if (ans == 4) { Console.WriteLine("TWO PAIR"); } else if (ans == 3) { Console.WriteLine("THREE CARD"); } else if (ans == 2) { Console.WriteLine("ONE PAIR"); } else { Console.WriteLine("NO HAND"); } } } }