input_line = input().split() a = [0] for i in range(13): a.append(input_line.count(str(i+1))) m = 1 for i in range(13): if a[i] != 0: m = m * a[i] if m == 6: print("FULL HOUSE") elif m == 3: print("THREE CARD") elif m == 4: print("TWO PAIR") elif m == 2: print("ONE PAIR") else: print("NO HAND")