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