#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); map mp; for(int i = 0; i < 5; i++) { int a; cin >> a; mp[a]++; } bool two1 = false, two2 = false, three = false; 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; return 0; } if(three) { cout << "THREE CARD" << endl; return 0; } if(two1 && two2) { cout << "TWO PAIR" << endl; return 0; } if(two1) { cout << "ONE PAIR" << endl; return 0; } cout << "NO HAND" << endl; return 0; }