import java.math.BigInteger; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] list = new int[5]; for(int i = 0; i < 5; i++) { list[i] = sc.nextInt(); } int[] sum = new int[14]; for(int i = 0; i < 5; i++) { sum[list[i]]++; } boolean A = false; boolean B = false; boolean C = false; for(int i = 0; i < 14; i++) { if(sum[i] == 3) A = true; else if(sum[i] == 2 && !B) B = true; else if(sum[i] == 2 && B) C = true; } if(A && B) System.out.println("FULL HOUSE"); else if(A) System.out.println("THREE CARD"); else if(B && C) System.out.println("TWO PAIR"); else if(B) System.out.println("ONE PAIR"); else System.out.println("NO HAND"); } }