import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int[] ar = new int[14]; for (int i=0; i<5; i++) { ar[sc.nextInt()]++; } int triple = 0; int pair = 0; for (int i=0; i<14; i++) { if (ar[i]==2) {pair++;} else if (ar[i]==3) {triple++;} } if (triple==1 && pair==1) {System.out.println("FULL HOUSE");} else if (triple==1 && pair==0) {System.out.println("THREE CARD");} else if (triple==0 && pair==2) {System.out.println("TWO PAIR");} else if (triple==0 && pair==1) {System.out.println("ONE PAIR");} else {System.out.println("NO HAND");} } }