from collections import Counter array = sorted(list(dict(Counter(map(int,input().split()))).values()))[::-1] if (len(array)==2) and array[0]==3 and array[1]==2: print("FULL HOUSE") elif array[0]==3: print("THREE CARD") elif array[0]==2 and array[1]==2: print("TWO PAIR") elif array[0]==2: print("ONE PAIR") else: print("NO HAND")