A = list(map(int, input().split())) d = dict.fromkeys(A, 0) for i in A: d[i] += 1 dict_values = list(d.values()) v = set(dict_values) if v == {2, 3}: print("FULL HOUSE") elif v== {1, 3}: print("THREE CARD") elif v == {2, 1}: if dict_values.count(2) == 1: print("ONE PAIR") else : print("TWO PAIR") else : print("NO HAND")