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; for (int i = 0; i < a.length - 1; i++) { if (a[i] == a[i + 1]) { match += 1; three |= (a[i] + 2 < a.length) && (a[i] == a[i + 2]); } } if (match == 3) { System.out.println("FULL HOUSE"); } else if (three) { 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"); } } }