#include using namespace std; using ll = long long; int a; map mp; bool two1 = false, two2 = false, three = false; int main() { for (int i = 0; i < 5; i++) { cin >> a; mp[a]++; } for (auto i : mp) { if (i.second == 3) three = true; if (i.second == 2 && !two1) { two1 = true; continue; } if (i.second == 2 && two1) two2 = true; } if (three && two1) cout << "FULL HOUSE" << endl; else if (three) cout << "THREE CARD" << endl; else if (two1 && two2) cout << "TWO PAIR" << endl; else if (two1) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; }