#include #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define all(v) v.begin(), v.end() #define mset(a, n) memset(a, n, sizeof(a)) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector vs; typedef vector > vvi; typedef vector > vpii; typedef pair pii; typedef pair pll; const int inf = 1000000000; const int mod = 1000000007; const double eps = 1e-9; const int dx[] = { -1, 0, 1, 0}; const int dy[] = { 0, -1, 0, 1}; int main() { // cin.tie(0); // tie // ios::sync_with_stdio(false); // sync map mp; rep(i, 5) { int a; cin >> a; mp[a]++; } if (mp.size() == 2) { for (auto i : mp) { if (i.second == 3 || i.second == 2) { cout << "FULL HOUSE" << endl; break; } else { cout << "NO HAND" << endl; break; } } } else if (mp.size() == 3) { for (auto i : mp) { if (i.second == 3) { cout << "THREE CARD" << endl; break; } else { cout << "TWO PAIR" << endl; break; } } } else if (mp.size() == 4) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } return 0; }