#include using namespace std; typedef long long ll; typedef pair P; const int INF = 1e9; const int mod = 1e9+7; const double EPS = 1e-10; const double PI = acos(-1.0); int main() { string s[5] = {"FULL HOUSE","THREE CARD","TWO PAIR","ONE PAIR","NO HAND"}; int a[5]; for(int i = 0; i < 5; i++) cin >> a[i]; sort(a,a+5); if(a[0] == a[2] || a[1] == a[3] || a[2] == a[4]){ if(a[1] == a[3]) cout << s[4] << endl; else if(a[0] == a[1] && a[3] == a[4]) cout << s[0] << endl; else cout << s[1] << endl; }else if(a[0] == a[1] || a[1] == a[2] ||a[2] == a[3] || a[3] == a[4]){ int cnt = 0; for(int i = 0; i < 4; i++) if(a[i] == a[i+1]) cnt++; if(cnt == 2) cout << s[2] << endl; else cout << s[3] << endl; }else cout << s[4] << endl; return 0; }