s=input() t,c,p=s.count("T"),s.count("C"),s.count("P") if c == 0: print("P"*p+"T"*t) else: print("T"*t+"C"*c+"P"*p)