import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[5]; for (int i = 0; i < 5; i++) a[i] = sc.nextInt(); for (int i = 0; i < a.length; i++) { for (int j = i + 1; j < a.length; j++) { if (a[i] > a[j]) { int tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } } int match = 0; boolean three = false; boolean four = false; for (int i = 0; i < a.length - 1; i++) { if (a[i] == a[i + 1]) { match += 1; three |= (i + 2 < a.length) && (a[i] == a[i + 2]); four |= (i + 3 < a.length) && (a[i] == a[i + 3]); } } if (match == 3 && !four) { System.out.println("FULL HOUSE"); } else if (three && !four) { System.out.println("THREE CARD"); } else if (match == 2) { System.out.println("TWO PAIR"); } else if (match == 1) { System.out.println("ONE PAIR"); } else { System.out.println("NO HAND"); } } }