# yukicoder No.227 簡単ポーカー from collections import Counter A = Counter(input().split()) judge = sorted(A.values()) if judge == [2, 3]: print("FULL HOUSE") elif judge == [1, 1, 3]: print("THREE CARD") elif judge == [1, 2, 2]: print("TWO PAIR") elif judge == [1, 1, 1, 2]: print("ONE PAIR") else: print("NO HAND")