Bob has been provided a string S of size N containing lowercase characters. He took two empty strings, U and V, and performed the following operations:
Bob can perform the above operations any number of times. After some operations, he wants to get the string S and U empty, and string V should be lexicographically minimum.
Your task is to help Bob find the lexicographically minimum possible string V that can be formed.
Input Format:
Output format:
For each test case, print the lexicographically minimum possible string V that can be formed.
Constraints:
1<=T<=5
1<=N<=105
S[i] will be a lowercase english character.
For the first test case:
First, we will append char a at the end of string U and then pop it and append at the end of string V.
Then we append char c, d, and a at string U and pop them one by one to get the final string aadc.
For the second test case:
Here string of length one and there is no other combination possible hence the answer is the string a.