import Collections as col a = col.Counter(list(map(int,input().split()))).values() if 3 in a and 2 in a: print("FULL HOUSE") elif 3 in a: print("THREE CARD") elif a.count(2) == 2: print("TWO PAIR") elif 2 in a: print("ONE PAIR") else: print("NO HAND")