#K60977. Smallest Lexicographic String
Smallest Lexicographic String
Smallest Lexicographic String
You are given a positive integer \(t\) and t strings. For each string, you are allowed to perform any number of adjacent swaps. Prove that by performing a series of such swaps, you can always rearrange the string into its lexicographically smallest form, which is simply the sorted order of its characters.
Your task is to take each string and output the smallest lexicographic string that can be obtained by sorting its characters.
Note: Although the problem statement mentions adjacent swaps, it is always possible to achieve the sorted order by repeated adjacent swaps. Therefore, the answer for each string is just the sorted string.
inputFormat
The first line contains a single integer t (\(1 \le t \le 10^5\)), the number of strings.
The following t lines each contain a non-empty string consisting of lowercase English letters.
outputFormat
Output t lines. Each line should contain the smallest lexicographic string obtainable from the corresponding input string by performing any number of adjacent swaps.
## sample1
cba
abc
</p>