import java.io.*; import java.util.Arrays; public class No227{ public static void main(String[] args) throws IOException{ String[] str = new BufferedReader(new InputStreamReader(System.in)).readLine().split(" "); int[] hand = new int[13]; int[] strToInt = new int[str.length]; for(int i=0; i < str.length; i++) strToInt[i] = Integer.parseInt(str[i]); for(int i=0; i < str.length; i++) hand[strToInt[i]]++; Arrays.sort(hand); reverse(hand); judge(hand); } public static void reverse(int[] a){ int temp = 0; for(int i=0; i < a.length / 2; i++){ temp = a[i]; a[i] = a[a.length - 1 - i]; a[a.length - 1 - i] = temp; } } public static void judge(int[] a){ if(a[0] == 3){ if(a[1] == 2) System.out.println("FULL HOUSE"); else System.out.println("THREE CARD"); } else if(a[0] == 2){ if(a[1] == 2) System.out. println("TWO PAIR"); else System.out.println("ONE PAIR"); } else System.out.println("NO HAND"); } }