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