#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); string s; cin>>s; int n=s.size(); int c=0,p=0,t=0; rep(i,n){ if(s[i]=='C') c++; else if(s[i]=='P') p++; else t++; } if(c>0){ rep(i,t) cout<<'T'; rep(i,c) cout<<'C'; rep(i,p) cout<<'P'; } else{ rep(i,p) cout<<'P'; rep(i,t) cout<<'T'; } cout<