solve this please..i am in hurry

You will be given a string containing small letters and digits. You have to sort the letters and digits in ascending order, without changing the relative position of the letters and digits. Please check the sample input and output if you are confused.First line will contain an integer N. Each of the next N line will contain a string of letters and digits. Maximum length of the string will be 79.

N lines, each line is the sorted string according to the problem description.
Sample
Input:2
a2c1b
ai5d2k3x325xOutput: a1b2c
ad2i2k3x355x

If I have understood your question then you can simply count the frequency of each letter and digits, and simply place the letters and digits in their respective places. Straightforward. Where are you facing problems?