S = input() if("C" in S): print("T"*S.count("T") + "C"*S.count("C") + "P"*S.count("P")) else: print("P"*S.count("P") + "T"*S.count("T"))