cards = input().split() s = set(cards) c3 = 0 c2 = 0 for i in s: if cards.count(i)==3: c3 += 1 elif cards.count(i)==2: c2 += 1 if c3==1 and c2==1: print("FULL HOUSE") elif c3==1: print("THREE CARD") elif c2==2: print("TWO PAIR") elif c2==1: print("ONE PAIR") else: print("NO HAND")