from collections import defaultdict def main(): l = input().split() d = defaultdict(int) for n in l: d[n] += 1 if sorted(d.values()) == [2, 3]: print("FULL HOUSE") elif 3 in d.values(): print("THREE CARD") elif [1, 2, 2] == sorted(d.values()): print("TWO PAIR") elif 2 in d.values(): print("ONE PAIR") else: print("NO HAND") if __name__ == '__main__': main()