#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); string s; cin >> s; if (!s.contains('C')) { sort(s.begin(), s.end()); cout << s << '\n'; } else { sort(s.begin(), s.end(), [](char a, char b) { auto tonum = [](char c) { if (c == 'T') return 0; if (c == 'C') return 1; if (c == 'P') return 2; assert(false); }; return tonum(a) < tonum(b); }); cout << s << '\n'; } return 0; }