#include using namespace std; /* alias */ using ull = unsigned long long; using ll = long long; using vi = vector; using vl = vector; using vll = vector; using vvi = vector; using vvl = vector; using vvll = vector; using vc = vector; using vs = vector; using pii = pair; /* define short */ #define pb push_back #define mp make_pair #define all(obj) obj.begin(), obj.end() #define bit(n) (1LL<<(n)) #define YESNO(bool) if(bool){cout<<"YES"<=0;i--) /* func */ inline int in_int() {int x; cin >> x; return x;} inline ll in_ll() {ll x; cin >> x; return x;} inline string in_str() {string x; cin >> x; return x;} // 第一引数と第二引数を比較し、第一引数(a)をより大きい/小さい値に上書き template inline bool chmin(T& a, const T& b) {bool compare = a > b; if (a > b) a = b; return compare;} template inline bool chmax(T& a, const T& b) {bool compare = a < b; if (a < b) a = b; return compare;} /* global */ const int INF = INT_MAX / 2; const ll LINF = 1LL << 60; const ll MOD = 1e9 + 7; int main(){ vi A(5); rep(i, 5){ cin >> A[i]; } vi same(5, 0); rep(i, 5){ rep(j, 5){ if(A[i] == A[j]){ same[i]++; } } } int sum = 0; rep(i, 5){ sum += same[i]; } if(sum == 13){ cout << "FULL HOUSE" << endl; }else if(sum == 11){ cout << "THREE CARD" << endl; }else if(sum == 9){ cout << "TWO PAIR" << endl; }else if(sum == 7){ cout << "ONE PAIR" << endl; }else{ cout << "NO HAND" << endl; } }