using namespace std;
int main() { int n; cin>>n; while(n--) { string s; cin>>s; sort(s.begin(),s.end(),greater<char>()); cout<<s<<endl; } }