import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Main { public static final int SIZE = 5; public static final int RANGE = 13; public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int[] arr = new int[SIZE]; for(int i = 0; i < SIZE; i++){ arr[i] = sc.nextInt() - 1; } int[] counts = new int[RANGE]; for(int i = 0; i < SIZE; i++){ counts[arr[i]]++; } int fst_max = 0, snd_max = 0; for(int i = 0; i < RANGE; i++){ if(fst_max < counts[i]){ snd_max = fst_max; fst_max = counts[i]; }else if(snd_max < counts[i]){ snd_max = counts[i]; } } switch(fst_max){ case 3: if(snd_max >= 2){ System.out.println("FULL HOUSE"); }else{ System.out.println("THREE CARD"); } break; case 2: if(snd_max >= 2){ System.out.println("TWO PAIR"); }else{ System.out.println("ONE PAIR"); } break; default: System.out.println("NO HAND"); break; } } }