import java.util.Scanner; public class Main { public static void main(String[] args) { // 標準入力から読み込む際に、Scannerオブジェクトを使う。 Scanner sc = new Scanner(System.in); int a1 = sc.nextInt(); int a2 = sc.nextInt(); int a3 = sc.nextInt(); int a4 = sc.nextInt(); int a5 = sc.nextInt(); int num[]; num = new int[5]; num[0]=a1; num[1]=a2; num[2]=a3; num[3]=a4; num[4]=a5; int a=0, b=0, c=0, d=0, e=0; for(int i=0; i<5; i++){ if(num[0]==num[i]){ a++; }else if(num[1]==num[i]){ b++; }else if(num[2]==num[i]){ c++; }else if(num[3]==num[i]){ d++; }else if(num[4]==num[i]){ e++; } } if(a==3&&b==2 || a==2&&b==3 || a==2&&c==3) System.out.println("FULL HOUSE"); else if(a==3 || b==3 || c==3) System.out.println("THREE CARD"); else if(a==2&&b==2 || a==2&&c==2 || a==2&&d==2 ||b==2&&d==2) System.out.println("TWO PAIR"); else if(a==2 || b==2 || c==2 || d==2) System.out.println("ONE PAIR"); else System.out.println("NO HAND"); } }