package yukicoder; import java.util.Scanner; public class poker { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] n = new int[14]; int[] a = new int[5]; int three = 0; int two = 0; for (int i = 0; i<5; i++) { a[i] = Integer.parseInt(sc.next()); } for (int i = 0; i < 5; i++) { n[a[i]]++; } for (int i = 0; i < n.length; i++) { switch (n[i]) { case 2 : two++; break; case 3 : three++; break; } } if (two == 1 && three == 1) { System.out.println("FULL HOUSE"); } else if (three == 1) { System.out.println("THREE CARD"); } else if (two == 2) { System.out.println("TWO PAIR"); } else if (two == 1) { System.out.println("ONE PAIR"); } else { System.out.println("NO HAND"); } } }