import java.util.Arrays; import java.util.Scanner; import java.util.TreeMap; import java.util.stream.IntStream; public class Main{ static Scanner s=new Scanner(System.in); static int getInt(){return Integer.parseInt(s.next());} static IntStream REPS(int v){return IntStream.range(0,v);} static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);} static IntStream INS(int n) {return REPS(n).map(i->getInt());} static class Pair{ T l;U r; Pair(T L,U R){l=L;r=R;} T getL(){return l;} U getR(){return r;} } public static void main(String[]$){ TreeMap hm=new TreeMap<>(); hm.merge(getInt(),1,Integer::sum); hm.merge(getInt(),1,Integer::sum); hm.merge(getInt(),1,Integer::sum); hm.merge(getInt(),1,Integer::sum); hm.merge(getInt(),1,Integer::sum); int[] v=hm.values().stream().mapToInt(i->i).sorted().toArray(); if(Arrays.equals(v,new int[]{2,3})) { System.out.println("FULL HOUSE"); }else if(Arrays.equals(v,new int[]{1,1,3})){ System.out.println("THREE CARD"); }else if(Arrays.equals(v,new int[]{1,2,2})){ System.out.println("TWO PAIR"); }else if(Arrays.equals(v,new int[]{1,1,1,2})){ System.out.println("ONE PAIR"); }else { System.out.println("NO HAND"); } } }