package yukicoder; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); try { String[] box = read.readLine().split(" "); int[] num = new int[5]; for (int i = 0; i < 5; ++i) { num[i] = Integer.parseInt(box[i]); } int[] count = new int[5]; for (int i = 0; i < 5; ++i) { for (int j = 0; j < 5; ++j) { if (i != j) { if (num[i] == num[j]) { count[i]++; } } } } boolean th = false, tw = false; int twCount = 0; for (int i = 0; i < 5; ++i) { if (count[i] == 2) { th = true; } else if (count[i] == 1) { tw = true; twCount++; } } if (th && tw) { System.out.println("FULL HOUSE"); } else if (th) { System.out.println("THREE CARD"); } else if (tw && twCount == 4) { System.out.println("TWO PAIR"); } else if (tw && twCount == 2) { System.out.println("ONE PAIR"); } else { System.out.println("NO HAND"); } } catch (Exception e) { e.printStackTrace(); } } }