import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int i, three = 0, two = 0; int[] count = new int[14]; for(i=0;i<5;i++){ count[sc.nextInt()]++; } for(i=1;i<14;i++){ if(count[i] == 2)two++; if(count[i] == 3)three++; } 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"); } }