#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; typedef pair pii; typedef vector vll; typedef vector vi; typedef vector> vvi; typedef vector> vvll; const ll inf = 1e16; const ll md = 1000000007; int main() { map cnt; int a; rep(i,5){ cin>>a; cnt[a]++; } int sz=cnt.size(); if(sz==2) puts("FULL HOUSE"); else if(sz==4) puts("ONE PAIR"); else if(sz==5) puts("NO HAND"); else{ for(const auto& [key,value]:cnt) if(value==3){ puts("THREE CARD"); return 0; } puts("TWO PAIR"); } return 0; }