#C8791. Sort Characters and Numbers
Sort Characters and Numbers
Sort Characters and Numbers
You are given one or more test cases. In each test case, you receive a string that consists of alphabetic characters and digits. Your task is to rearrange each string such that all the alphabetic characters appear first (in the same order as they appear in the input) followed by all the digit characters (also in the order they appear in the input).
For example, given the string a1b2c3
, the sorted result is abc123
.
Note: You must read from standard input and output to standard output.
inputFormat
The first line contains an integer T representing the number of test cases. Each of the following T lines contains a single string that consists of alphabets and digits.
outputFormat
For each test case, output a single line containing the rearranged string such that all letters come first followed by all numbers.
## sample1
a1b2c3
abc123