s=input() t=s.count('T') c=s.count('C') p=s.count('P') if c: print('T'*t+'C'*c+'P'*p) else: print(''.join(sorted(s)))