#include using namespace std; int a[13]; bool one, two, three; int main() { int t; for (int i = 0; i < 5; i++) { cin >> t; a[t - 1]++; } for (int i = 0; i < 13; i++) { if (a[i] == 3) three = true; else if (a[i] == 2 && one) two = true; else if (a[i] == 2 && !one) one = true; } if (three && one) cout << "FULL HOUSE" << endl; else if (three) cout << "THREE CARD" << endl; else if (two) cout << "TWO PAIR" << endl; else if (one) cout << "ONE PAIR" << endl; else cout << "NO HAND" << endl; return 0; }