import java.util.Scanner; public class cade { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] A = new int[5]; for(int i=0;i<5;i++){ A[i] = Integer.parseInt(s.next()); } boolean F=false; boolean TH=false; boolean TW=false; boolean O=false; int cut = 0; for(int i=0;i<4;i++){ for(int j=i+1;j<5;j++){ if(A[i] == A[j]){ cut++; } } if(cut==3){ TH = true; } if(cut==2){ TW = true; } if(cut==1){ O = true; } if(TH && TW){ F = true; } } if(F){ System.out.println("FULL HOUSE"); }else if(TH){ System.out.println("THREE CARD"); }else if(TW){ System.out.println("TWO PAIR"); }else if(O){ System.out.println("ONE PAIR"); }else{ System.out.println("NO HAND"); } } }