S=list(input()) def k(S): if(S=="P"): return 2 elif(S=='C'): return 1 else: return 0 S.sort(key=k) print("".join(S))