s=input() T=s.count("T") C=s.count("C") P=s.count("P") print(f'{"T"*T}{"C"*C}{"P"*P}')