#include using namespace std; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); } } initializer; class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x> c(m, vector(n));for(auto& r:c)for(auto& i:r)cin>>i; #define FOR(i,a,n) for(int i=(a), i##_len=(n); i=(a); --i) #define RFORS(i,a,b) for(int i=(b); i>=(a); --i) #define REP(i,n) for(int i=0, i##_len=(n); i=0; --i) #define RREPS(i,n) for(int i=(n); i>=0; --i) #define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c))) #define PB push_back #define EM emplace #define EB emplace_back #define BI back_inserter #define MP make_pair #define FI first #define SE second #define DUMP( x ) cerr << #x << " = " << ( x ) << endl #define SZ(x) ((int)(x).size()) #define cauto const auto& // 型 typedef long long ll; typedef pair pii; typedef pair pss; typedef pair psi; typedef pair pis; typedef vector vi; typedef vector vd; typedef vector vl; typedef vector vll; typedef vector vs; // Effective std template void remove(vector& c, unsigned int index) { c.erase(c.begin()+index); } template inline istream& operator>>(istream &s, vector &v) { for (T &t : v) s >> t; return s; } template inline ostream& operator<<(ostream &s, const vector &v) { for (const T &t : v) s << t << endl; return s; } template inline bool chmin(T &a, const T &b){if (b < a) {a = b; return true;} return false; } template inline bool chmax(T &a, const T &b){if (a < b) {a = b; return true;} return false; } #define UNIQUE(v) v.erase( unique(ALL(v)), v.end() ); // 定数 constexpr int PI = (2*acos(0.0)); constexpr int EPS = (1e-9); constexpr int MOD = (int)(1e9+7); constexpr int INF = 100000000; vector split(const string &str, char sep) { vector v; stringstream ss(str); string buffer; while( getline(ss, buffer, sep) ) { v.push_back(stoi(buffer)); } return v; } int main(){ vi v(5, 0); cin >> v; vi a(14, 0); int card2 = 0, card3 = 0; REP(i, 5) ++a[v[i]]; REPS(i, 14) if (a[i] == 3) ++card3; else if (a[i] == 2) ++card2; string s = ""; if (card3 == 1) if (card2 == 1) s = "FULL HOUSE"; else s = "THREE CARD"; else if (card2 == 2) s = "TWO PAIR"; else if (card2 == 1) s = "ONE PAIR"; else s = "NO HAND"; P(s); return 0; }