import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input =new Scanner(System.in);
int f=input.nextInt();
while(f>0){
String str;
Scanner sc = new Scanner(System.in);
//System.out.print("请输入字符串:");
str = sc.nextLine();
char[] chs = str.toCharArray();
bubbleSort(chs);
//System.out.println(bubbleSort(chs));
--f;
}
}
public static void bubbleSort(char[] chs)
{
char temp ='a';
int size = chs.length;
for(int i = 0 ; i < size-1; i ++)
{
for(int j = 0 ;j < size-1-i ; j++)
{
if(chs[j] > chs[j+1]) //交换两数位置
{
temp = chs[j];
chs[j] = chs[j+1];
chs[j+1] = temp;
}
}
}
for(int j = 0 ;j < size ; j++)
{
System.out.print(chs[j]);
System.out.print(' ');
}
//return chs;
}
}
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input =new Scanner(System.in);
int f=input.nextInt();
while(f>0){
String str;
Scanner sc = new Scanner(System.in);
//System.out.print("请输入字符串:");
str = sc.nextLine();
char[] chs = str.toCharArray();
bubbleSort(chs);
//System.out.println(bubbleSort(chs));
--f;
}
}
public static void bubbleSort(char[] chs)
{
char temp ='a';
int size = chs.length;
for(int i = 0 ; i < size-1; i ++)
{
for(int j = 0 ;j < size-1-i ; j++)
{
if(chs[j] > chs[j+1]) //交换两数位置
{
temp = chs[j];
chs[j] = chs[j+1];
chs[j+1] = temp;
}
}
}
for(int j = 0 ;j < size ; j++)
{
System.out.print(chs[j]);
System.out.print(' ');
}
//return chs;
}
}