A,B,C,D,E = list(map(int,input().split())) cards = [A,B,C,D,E] variety_cards = set(cards) a = cards.count(A) b = cards.count(B) c = cards.count(C) d = cards.count(D) e = cards.count(E) if len(variety_cards) == 2: if cards.count(A) == 3 or cards.count(A) == 2: print("FULL HOUSE") else: print("NO HAND") if len(variety_cards) == 3: if max(a,b,c,d,e) == 3: print("THREE CARD") else: print("TWO PAIR") if len(variety_cards) == 4: print("ONE PAIR") else: print("NO HAND")