#include using namespace std; typedef long long ll; int a[14]; int main() { for (int i = 0; i < 5; ++i) { int b; cin >> b; a[b]++; } sort(a, a + 14, greater()); if (a[0] == 3 && a[1] == 2) { cout << "FULL HOUSE" << endl; } else if (a[0] == 3) { cout << "THREE CARD" << endl; } else if (a[0] == 2 && a[1] == 2) { cout << "TWO PAIR" << endl; } else if (a[0] == 2) { cout << "ONE PAIR" << endl; } else { cout << "NO HAND" << endl; } }