import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] n = new int[14]; int[] m = new int[6]; for(int i = 0; i < 5; i++){ n[sc.nextInt()]++; } for(int i = 1; i < 14; i++){ m[n[i]]++; } if(m[2]*m[3] == 1){ System.out.println("FULL HOUSE"); } else if(m[3] == 1){ System.out.println("THREE CARD"); } else if(m[2] == 2){ System.out.println("TWO PAIR"); } else if(m[2] == 1){ System.out.println("ONE PAIR"); } else { System.out.println("NO HAND"); } } }