#include #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,b) FOR(i,0,b) #define PB push_back #define F first #define S second using namespace std; typedef long long LL; typedef LL ut; typedef vector VI; typedef pair pr; typedef pair ppr; typedef vector Vppr; typedef priority_queue > PQ; const int INF=1e+9; int card[20],nums[20],thenums[20]; int main(){ REP(i,5){ cin >> card[i]; nums[card[i]]++; } FOR(i,1,14){ thenums[nums[i]]++; } if(thenums[2]&&thenums[3]) cout <<"FULL HOUSE" << endl; else if(thenums[3]) cout << "THREE CARD" << endl; else if(thenums[2]==2) cout <<"TWO PAIR" << endl; else if(thenums[2]) cout<<"ONE PAIR" << endl; else cout << "NO HAND" << endl; }