n = list(map(int,input().split())) s = [0]*13 for i in n: s[i-1] += 1 if 3 in s and 2 in s: print("FULL HOUSE") elif 3 in s: print("THREE CARD") elif s.count(2) == 2: print("TWO PAIR") elif s.count(2) == 1: print("ONE PAIR") else: print("NO HAND")