#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; map M = { {'T',0}, {'C',1}, {'P',2} }; sort(s.begin(),s.end(),[&](auto &a,auto &b){ return M[a] < M[b]; }); cout << s << endl; }