import java.io.*; import java.util.*; import java.util.ArrayList; import java.util.Arrays; public class Main { public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int[] hand = new int[5]; for(int i=0;i<5;i++) hand[i]=sc.nextInt(); Arrays.sort(hand); if(hand[0]==hand[1] && hand[1]==hand[2]&&hand[2]==hand[3]){ System.out.println("NO HAND"); return; } if(hand[1]==hand[2] &&hand[2]==hand[3]&&hand[3]==hand[4]){ System.out.println("NO HAND"); return; } if(hand[0]==hand[1]&&hand[1]==hand[2] && hand[3]==hand[4] &&hand[0]!=hand[3]|| hand[0]==hand[1] && hand[2]==hand[3] &&hand[3]==hand[4]&&hand[0]!=hand[3]){ System.out.println("FULL HOUSE"); return; } if(hand[0]==hand[1] && hand[1]==hand[2] &&hand[0]!=hand[3] && hand[0]!=hand[4]|| hand[4]==hand[3] && hand[3]==hand[2]&&hand[4]!=hand[1]&&hand[4]!=hand[0]){ System.out.println("THREE CARD"); return; } if(hand[0]==hand[1] && hand[2]==hand[3] || hand[0]==hand[1]&&hand[3]==hand[4]||hand[1]==hand[2]&&hand[3]==hand[4]){ System.out.println("TWO PAIR"); return; } if(hand[0]==hand[1] || hand[1]==hand[2] || hand[2]==hand[3]||hand[3]==hand[4]){ System.out.println("ONE PAIR"); return; } System.out.println("NO HAND"); } }