#include #include #include using namespace std; static inline const string& solve(string& S) noexcept { vector count_of(128, 0); uint32_t i; for (i = 0; i != S.size(); ++i) ++count_of[S[i]]; if (count_of['C'] == 0) { for (i = 0; count_of['P'] != 0; --count_of['P'], ++i) S[i] = 'P'; for (; count_of['T'] != 0; --count_of['T'], ++i) S[i] = 'T'; } else { for (i = 0; count_of['T'] != 0; --count_of['T'], ++i) S[i] = 'T'; for (; count_of['C'] != 0; --count_of['C'], ++i) S[i] = 'C'; for (; count_of['P'] != 0; --count_of['P'], ++i) S[i] = 'P'; } return S; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string S; S.reserve(100), cin >> S; cout << solve(S) << '\n'; return 0; }