Chef is given a binary string
of length . He can perform the following operation on any number of times:
- Choose and , such that, in the substring , the number of s is equal to the number of s and reverse the substring .
Find the lexicographically smallest string that Chef can obtain after performing the above operation any (possibly zero) number of times on .
String is lexicographically smaller than string , if either of the following satisfies:
- is a prefix of and .
- There exists an index such that and such that .
Input Format
- First line will contain , the number of test cases. Then the test cases follow. Each test case contains two lines.
- The first line contains the integer , the length of the binary string.
- The second line contains the binary string .
Output Format
For each test case, print the lexicographically smallest binary string that can be obtained after performing the operation any (possibly zero) number of times.
Constraints
- Sum of over all test cases does not exceed .
Sample Input 1
2
5
01100
4
0000
Sample Output 1
00011
0000
Explanation
Test Case : Chef can choose and . The chosen substring, . On reversing this, we get . Thus, the final string is . Note that this is the lexicographically smallest string possible.
Test Case : Since the string is already lexicographically minimum, Chef does not need to apply any operation.
ConversionConversion EmoticonEmoticon