import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); int d = scanner.nextInt(); int e = scanner.nextInt(); int[] list = {a, b, c, d, e}; Arrays.sort(list); // System.out.println(Arrays.toString(list)); List countList = new ArrayList(); int prev = 0; int count = 1; for (int i = 0; i < 5; i++) { if (i != 0) { if (prev == list[i]) { count++; } else { countList.add(count); count = 1; } } prev = list[i]; } countList.add(count); // System.out.println(countList); if (countList.contains(3)) { if (countList.contains(2)) { System.out.println("FULL HOUSE"); } else { System.out.println("THREE CARD"); } } else { if (countList.contains(2)) { int twoNum = Collections.frequency(countList, 2); if (twoNum == 2) { System.out.println("TWO PAIR"); } else { System.out.println("ONE PAIR"); } } else { System.out.println("NO HAND"); } } } }