#ifdef ONLINE_JUDGE #include #include #else #include #endif using namespace std; using ll=long long; using namespace atcoder; using mint=modint998244353; #define rep1(i, r) for(int i=0; i<(int)(r); ++i) #define rep2(i, l, r) for(int i=(l); i<(int)(r); ++i) #define rep3(i, l, r, d) for(int i=(l); i<(int)(r); i+=(d)) #define rep_r1(i, r) for(int i=(r)-1; i>=0; --i) #define rep_r2(i, l, r) for(int i=(r)-1; i>=(l); --i) #define rep_r3(i, l, r, d) for(int i=(r)-1; i>=(l); i-=(d)) #define fifth(a, b, c, d, e, ...) e #define rep(...) fifth(__VA_ARGS__, rep3, rep2, rep1)(__VA_ARGS__) #define rep_r(...) fifth(__VA_ARGS__, rep_r3, rep_r2, rep_r1)(__VA_ARGS__) template void in(T &... args) { (cin >> ... >> args); } template void in_z(T &... args) { (cin >> ... >> args); (..., --args); } #define in_d(type, ...) type __VA_ARGS__; in(__VA_ARGS__) #define in_dz(type, ...) type __VA_ARGS__; in_z(__VA_ARGS__) template void in_i(It first, It last) { for(It it=first;it!=last;++it){ in(*it); } } template void in_iz(It first, It last) { for(It it=first;it!=last;++it){ in(*it); --*it; } } template struct str_literal { static constexpr int length=N-1; char buf[N]; constexpr str_literal(const char (&s_literal)[N]){ rep(i, N){ buf[i]=s_literal[i]; } buf[length]='\0'; } }; template ostream & operator<<(ostream & os, const str_literal & str) { os << str.buf; return os; } template void out() { cout << tail; if(do_flush){ cout << flush; } } template void out(const Hd & hd, const Tl &... tl) { cout << hd; if constexpr (sizeof...(Tl)){ (cout << ... << (cout << split, tl)); } cout << tail; if(do_flush){ cout << flush; } } template void out_i(It first, It last) { for(It it=first;it!=last;++it){ if(it!=first){ cout << split; } cout << *it; } cout << tail; if(do_flush){ cout << flush; } } template void err() { cerr << tail; if(do_flush){ cout << flush; } } template void err(const Hd & hd, const Tl &... tl) { cerr << hd; if constexpr (sizeof...(Tl)){ (cerr << ... << (cerr << split, tl)); } cerr << tail; if(do_flush){ cout << flush; } } template void err_i(It first, It last) { for(It it=first;it!=last;++it){ if(it!=first){ cerr << split; } cerr << *it; } cerr << tail; if(do_flush){ cout << flush; } } #define dir(dx, dy) for(auto [dx, dy]: {pair{1, 0}, {0, 1}, {-1, 0}, {0, -1}}) #define dir_8(dx, dy) for(auto [dx, dy]: {pair{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}}) #define all(v) (v).begin(), (v).end() #define all_r(v) (v).rbegin(), (v).rend() #define dedup(v) (v).erase(unique(all(v)), (v).end()) #define yn(b) ((b) ? "Yes" : "No") template bool chmin(T1 & l, const T2 & r) { if(r bool chmax(T1 & l, const T2 & r) { if(r>l){ l=r; return true; } return false; } template auto min_of(Hd1 hd1, Hd2 hd2, Tl... tl) { if constexpr (sizeof...(Tl)==0){ return min(hd1, hd2); } else { return min(hd1, min_of(hd2, tl...)); } } template auto max_of(Hd1 hd1, Hd2 hd2, Tl... tl) { if constexpr (sizeof...(Tl)==0){ return max(hd1, hd2); } else { return max(hd1, max_of(hd2, tl...)); } } template auto gcd_of(Hd1 hd1, Hd2 hd2, Tl... tl) { if constexpr (sizeof...(Tl)==0){ return gcd(hd1, hd2); } else { return gcd(hd1, gcd_of(hd2, tl...)); } } template auto lcm_of(Hd1 hd1, Hd2 hd2, Tl... tl) { if constexpr (sizeof...(Tl)==0){ return lcm(hd1, hd2); } else { return lcm(hd1, lcm_of(hd2, tl...)); } } template auto make_vector(vector & sizes, T const& x) { if constexpr (N==1){ return vector(sizes[0], x); } else { size_t size=sizes[N-1]; sizes.pop_back(); return vector(size, make_vector(sizes, x)); } } template auto make_vector(size_t const(&sizes)[N], T const& x=T()) { vector s(N); rep(i, N){ s[i] = sizes[N-i-1]; } return make_vector(s, x); } template auto make_vector(vector & sizes, T const& x) { if constexpr (N==1){ return vector(sizes[0], x); } else { int size=sizes[N-1]; sizes.pop_back(); return vector(size, make_vector(sizes, x)); } } template auto make_vector(int const(&sizes)[N], T const& x=T()) { vector s(N); rep(i, N){ s[i] = sizes[N-i-1]; } return make_vector(s, x); } template auto make_array() { if constexpr (sizeof...(Tl)==0){ return array{}; } else { return array()), Hd>{}; } } constexpr int inf32=1'000'000'001; constexpr ll inf64=2'000'000'000'000'000'001; constexpr ll ten_powers[19]={ 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000, 100000000000000000, 1000000000000000000 }; template constexpr S e_const() { return e; } template constexpr pair e_pair() { return {e1, e2}; } template S op_min(S a, S b) { return min(a, b); } template S op_max(S a, S b) { return max(a, b); } template S op_add(S a, S b) { return a+b; } template pair op_add_pair(pair a, pair b) { auto [a1, a2]=a; auto [b1, b2]=b; return {a1+b1, a2+b2}; } template S mapping_affine(pair f, S x) { auto [a, b]=f; return a*x+b; } template pair mapping_len_and_affine(pair f, pair x) { auto [a, b]=f; auto [x1, x2]=x; return {x1, a*x2+b*x1}; } template pair composition_affine(pair f, pair g) { auto [a_f, b_f]=f; auto [a_g, b_g]=g; return {a_f*a_g, a_f*b_g+b_f}; } int main(void) { cout << fixed << setprecision(15); cerr << fixed << setprecision(15); in_d(string, s); int c{},p{},t{}; int n=s.size(); rep(i, n){ if(s[i]=='C'){ ++c; } else if(s[i]=='P'){ ++p; } else { ++t; } } if(c){ out(string(t, 'T')+string(c, 'C')+string(p, 'P')); } else { out(string(p, 'P')+string(t, 'T')); } return 0; }