import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int A[] = new int[5]; for(int i = 0; i < 5; i++) { A[i] = scan.nextInt(); } scan.close(); Arrays.sort(A); int cnt = 0; int index = 0; int state[] = new int[5]; Arrays.fill(state, 0); for(int i = 0; i < 4; i++) { if(A[i] == A[i + 1]) { cnt ++; state[index] = cnt; }else { cnt = 0; index ++; } } Arrays.sort(state); // for(int t : state) { // System.out.print(t + " "); // } if(state[4] == 2 && state[3] == 1) { System.out.println("FULL HOUSE"); }else if(state[4] == 2 && state[3] == 0) { System.out.println("THREE CARD"); }else if(state[4] == 1 && state[3] == 1) { System.out.println("TWO PAIR"); }else if(state[4] == 1 && state[2] == 0) { System.out.println("ONE PAIR"); }else { System.out.println("NO HAND"); } } }