import java.util.Map; import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); Map map=new TreeMap(); for(int i=0;i<5;i++) { int buf=sc.nextInt(); if(map.containsKey(buf)) { map.put(buf,map.get(buf)+1); }else { map.put(buf,1); } } int CountTree=0; int CountTwo=0; for(Integer i:map.values()) { if(i.intValue()==3) { CountTree++; }else if(i.intValue()==2){ CountTwo++; } } String result=null; if(CountTree==1 && CountTwo==1) { result="FULL HOUSE"; }else if(CountTree==1) { result="THREE CARD"; }else if(CountTwo==2) { result="TWO PAIR"; }else if(CountTwo==1) { result="ONE PAIR"; }else { result="NO HAND"; } System.out.println(result); } }