#include using namespace std; int main() { int memo[13]; int i, a[5]; string s[5] = {"NO HAND", "FULL HOUSE", "THREE CARD", "TWO PAIR", "ONE PAIR"}; for (i = 0; i < 5; i++) { scanf("%d", &a[i]); memo[a[i] - 1]++; } int c = 0, d = 0; for (i = 0; i < 13; i++) { c += (memo[i] == 2); d += (memo[i] == 3); } int ans = 0; if (c == 1 && d == 1) ans = 1; else if (d == 1) ans = 2; else if (c == 2) ans = 3; else if (c == 1) ans = 4; printf("%s\n", s[ans]); return 0; }