import java.io.BufferedReader; import java.io.InputStreamReader; public class No227 { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader( System.in)); int[] card = new int[14]; int[] a = strToIntArray(br.readLine()); for (int i : a) { card[i]++; } int three = 0; int two = 0; for (int i : card) { if (i == 3) { three++; } else if (i == 2) { two++; } } if (three == 1 && two == 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"); } } catch (Exception e) { e.printStackTrace(); System.err.println("Error:" + e.getMessage()); } } static int[] strToIntArray(String S) { String[] strArray = S.split(" "); int[] intArray = new int[strArray.length]; for (int i = 0; i < strArray.length; i++) { intArray[i] = Integer.parseInt(strArray[i]); } return intArray; } }