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