#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
map<int,int> a;
int main(){
    for(int i = 0; 5 > i; i++){
        int t;cin>>t;
        a[t]+=1;
    }
    vector<int> x;
    for(auto&& z:a){
        x.push_back(z.second);
    }
    sort(x.begin(),x.end(),greater<int>());
    if(x[0] == 3){
        if(x[1] == 2){
            cout << "FULL HOUSE" << endl;
        }else{
            cout << "THREE CARD" << endl;
        }
    }else if(x[0] == 2){
        if(x[1] == 2){
            cout << "TWO PAIR" << endl;
        }else{
            cout << "ONE PAIR" << endl;
        }
    }else{
        cout << "NO HAND" << endl;
    }
}