# include <stdio.h> int main() { int n; char str[3],t; scanf("%d",&n); while(n--) { scanf("%s",str); if(str[0]>str[1]) { t=str[0]; str[0]=str[1]; str[1]=t; } if(str[1]>str[2]) { t=str[1]; str[1]=str[2]; str[2]=t; } if(str[0]>str[1]) { t=str[0]; str[0]=str[1]; str[1]=t; } printf("%c %c %c\n",str[0],str[1],str[2]); } return 0; }