import java.util.*; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); Map map=new HashMap<>(); for(int i=1;i<=13;i++){ map.put(i,0); } for(int i=0;i<5;i++){ int num=sc.nextInt(); int value=map.get(num)+1; map.put(num,value); } int count_3=0; int count_2=0; for(int key:map.keySet()){ int value=map.get(key); if(value==3){ count_3++; }else if(value==2){ count_2++; } } if(count_3==1 && count_2==1){ System.out.println("FULL HOUSE"); }else if(count_3==1){ System.out.println("THREE CARD"); }else if(count_2==2){ System.out.println("TWO PAIR"); }else if(count_2==1){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }