def main(): nyuryoku = list(map(int, input().split())) result_dict = {} for i in nyuryoku: result_dict[i] = 0 for s in nyuryoku: result_dict[s] += 1 kosuu = len(result_dict) if kosuu == 1 or kosuu == 5: print("NO HAND") elif kosuu == 2 and max(result_dict.values()) == 3: print("FULL HOUSE") elif kosuu == 2 and max(result_dict.values()) == 4: print("NO HAND") elif kosuu == 4: print("ONE PAIR") elif kosuu == 3 and max(result_dict.values()) == 3: print("THREE CARD") else: print("TWO PAIR") if __name__ == '__main__': main()