import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ HashMapmap=new HashMap(); LinkedListqueue=new LinkedList(); for(int i=0;i<5;i++){ int temp=sc.nextInt(); if(map.containsKey(temp)==false){ map.put(temp,1); queue.offer(temp); }else{ map.put(temp,map.get(temp)+1); } }Collections.sort(queue); if(queue.size()==2){ boolean flag=false; for(Integer element:queue){ if(map.get(element)==4)flag=true; }if(flag)System.out.println("NO HAND"); else System.out.println("FULL HOUSE"); }else if(queue.size()==3){ boolean flag=false; for(Integer element:queue){ if(map.get(element)==3)flag=true; }if(flag)System.out.println("THREE CARD"); else System.out.println("TWO PAIR"); }else if(queue.size()==4){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }