from collections import Counter S = input() if Counter(S)["C"] == 0: print("P" * Counter(S)["P"], end="") print("T" * Counter(S)["T"], end="") else: print("T" * Counter(S)["T"], end="") print("C" * Counter(S)["C"], end="") print("P" * Counter(S)["P"], end="") print()