import java.io.*; import java.util.*; class Main227 { public static void disp (Object obj) { System.out.println(obj); } public static String solve (int[] hand) { int cntTwo = 0, cntThree = 0; int[] seq = new int[14]; for (int h : hand) seq[h]++; for (int s : seq) { if (s == 2) cntTwo++; if (s == 3) cntThree++; } if (cntThree == 1 && cntTwo == 1) { return "FULL HOUSE"; } else if (cntThree == 1 && cntTwo == 0) { return "THREE CARD"; } else if (cntThree == 0 && cntTwo == 2) { return "TWO PAIR"; } else if (cntThree == 0 && cntTwo == 1) { return "ONE PAIR"; } else { return "NO HAND"; } } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] line = br.readLine().split(" "); int[] hand = new int[line.length]; for (int i = 0; i < line.length; i++) hand[i] = Integer.parseInt(line[i]); disp(solve(hand)); } }