import java.util.*; public class EasyPorker { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int[] card = new int[5]; for(int i=0;i<5;i++){ card[i]=scan.nextInt(); } Map cardNum = new HashMap(); int count=0; for(int i=0; i < 5; i++){ if(!cardNum.containsKey(card[i])){ cardNum.put(card[i], 1); }else{ int getNum = cardNum.get(card[i]); getNum++; cardNum.put(card[i], getNum); } } System.out.println(checkHands(cardNum)); } public static String checkHands(Map cardNum){ boolean check_two=false; boolean check_three=false; boolean check_full=false; boolean check_two2=false; boolean check_three2=false; boolean check_full2=false; boolean e=false; switch(cardNum.size()){ case 5: return "NO HAND"; case 4: return "ONE PAIR"; case 3: for(int i = 1; i <= 13; i++){ if(cardNum.containsKey(i)){ int get = cardNum.get(i); if(get==2){ check_two=true; check_full=true; check_three=false; }else if(get==3){ check_three2=true; check_full2=true; check_two2=false; } } } if(check_two&&!check_two2)return "TWO PAIR"; if(!check_three&&check_three2)return "THREE CARD"; if(check_full&&check_full2)return "FULL HOUSE"; break; case 2: for(int i=1;i<=13;i++){ if(cardNum.containsKey(i)){ int get = cardNum.get(i); if(get==2){ check_full=true; check_three=false; }else if(get==3){ check_full2=true; check_three2=false; }else if(get==4){ e=true; } } } if(check_full&&check_full2)return "FULL HOUSE"; if(!check_three&&check_three2)return "THREE CARD"; if(e)return "NO HAND"; break; case 1: return "NO HAND"; } return null; } }