#include "bits/stdc++.h" using namespace std; #define print(x) cout< PI; typedef pair V; typedef vector VE; const ll mod = 100000000000; using namespace std; int main() { std::vector dp(15); std::vector a(5); REP(i,5){ cin>>a[i]; dp[a[i]]++; } int thr=0,two=0; REP(i,15){ if(dp[i]==3){thr=1;} else if(dp[i]==2){two++;} } if(thr==1 && two==1){print("FULL HOUSE");} else if(thr==1 && two==0){print("THREE CARD");} else if(thr==0 && two==1){print("ONE PAIR");} else if(thr==0 && two==2){print("TWO PAIR");} else {print("NO HAND")} }