import collections cards=collections.Counter(list(map(int,input().split()))) f0=cards.most_common()[0][1] try: f1=cards.most_common()[1][1] except: pass if f0==3 and f1==2: print("FULL HOUSE") elif f0==3: print("THREE CARD") elif f0==2 and f1==2: print("TWO PAIR") elif f0==2: print("ONE PAIR") else: print("NO HAND")