import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main (String[] args) { // 入力値の読み込み Scanner sc = new Scanner(System.in); ArrayList a=new ArrayList<>(); for(int i=0;i<5;i++){ a.add(sc.next()); } int three=0; int two=0; String ans = "NO HAND"; // カウント TreeSet b=new TreeSet<>(a); for(String s:b){ int coun=0; for(String c:a){ if(s.equals(c))coun++; } if(coun == 3){ three +=1; }else if(coun == 2){ two +=1; } } // 判定 if(three==1){ if(two==1){ ans="FULL HOUSE"; }else{ ans="THREE CARD"; } }else if(two==2){ ans="TWO PAIR"; }else if(two==1){ ans="ONE PAIR"; } System.out.println(ans); } }