#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; struct edge { int u, v; ll w; }; ll MOD = 1000000007; ll _MOD = 1000000009; double EPS = 1e-10; int main() { vector A(5); cin >> A[0] >> A[1] >> A[2] >> A[3] >> A[4]; sort(A.begin(), A.end()); if (A[0] == A[2] && A[3] == A[4] && A[2] != A[3] || A[0] == A[1] && A[2] == A[4] && A[1] != A[2]) cout << "FULL HOUSE" << endl; else if (A[0] == A[2] || A[1] == A[3] || A[2] == A[4]) cout << "THREE CARD" << endl; else if (A[0] == A[1] && A[2] == A[3] && A[1] != A[2] || A[0] == A[1] && A[3] == A[4] && A[1] != A[3] || A[1] == A[2] && A[3] == A[4] && A[2] != A[3]) cout << "TWO PAIR" << endl; else if (A[0] == A[1] || A[1] == A[2] || A[2] == A[3] || A[3] == A[4]) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; }