a = [int(x) for x in input().split()] hands = {} for i in range(1, 13): hands[i] = 0 for i in a: hands[i] += 1 rank = "" flg3 = False flg2 = False for i in hands.keys(): if hands[i] == 4 or hands[i] == 5: break elif hands[i] == 3: if flg2: rank = "FULL HOUSE" break flg3 = True elif hands[i] == 2: if flg2: rank = "TWO PAIR" break elif flg3: rank = "FULL HOUSE" break flg2 = True if rank == "": if flg2: rank = "ONE PAIR" elif flg3: rank = "THREE CARD" else: rank = "NO HAND" print(rank)