#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair P; #define EACH(i,a) for (auto& i : a) #define FOR(i,a,b) for (ll i=(a);i<(b);i++) #define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--) #define REP(i,n) for (ll i=0;i<(n);i++) #define RREP(i,n) for (ll i=(n)-1;i>=0;i--) #define debug(x) cout<<#x<<": "< istream& operator>>(istream& is, vector& vec) { EACH(x,vec) is >> x; return is; } template ostream& operator<<(ostream& os, vector& vec) { REP(i,vec.size()) { if (i) os << " "; os << vec[i]; } return os; } template ostream& operator<<(ostream& os, vector< vector >& vec) { REP(i,vec.size()) { if (i) os << endl; os << vec[i]; } return os; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); vector A(5); cin >> A; vector cnt(15); REP(i, 5) cnt[A[i]]++; sort(ALL(cnt), greater()); if (cnt[0] == 3 && cnt[1] == 2) { cout << "FULL HOUSE" << endl; } else if (cnt[0] == 3) { cout << "THREE CARD" << endl; } else if (cnt[0] == 2 && cnt[1] == 2) { cout << "TWO PAIR" << endl; } else if (cnt[0] == 2) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } }