#include <bits/stdc++.h>
using namespace std;
void printVec(vector<char> f){
for(int i=0;i<f.size();i++){
cout << f[i];
}
cout << endl;
}
int main() {
int t;
cin >> t;
while(t--){
string s;
cin >> s;
vector<char> a;
for(int i=0;i<s.size();i++){
a.push_back(s[i]);
}
sort(a.begin(),a.end());
printVec(a);
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHByaW50VmVjKHZlY3RvcjxjaGFyPiBmKXsKCWZvcihpbnQgaT0wO2k8Zi5zaXplKCk7aSsrKXsKCQljb3V0IDw8IGZbaV07Cgl9Cgljb3V0IDw8IGVuZGw7Cn0KaW50IG1haW4oKSB7CglpbnQgdDsKCWNpbiA+PiB0OwoJd2hpbGUodC0tKXsKCQlzdHJpbmcgczsKCQljaW4gPj4gczsKCQl2ZWN0b3I8Y2hhcj4gYTsKCQlmb3IoaW50IGk9MDtpPHMuc2l6ZSgpO2krKyl7CgkJCWEucHVzaF9iYWNrKHNbaV0pOwoJCX0KCQlzb3J0KGEuYmVnaW4oKSxhLmVuZCgpKTsKCQlwcmludFZlYyhhKTsKCX0KCXJldHVybiAwOwp9