Those blood-soaked shores of Kalimdor is like a ghost haunting Jaina Proudmoore ever since the day she pushed her father into hell.
\space \space Now, standing in front of the devastated ruins of Theramore, she knew how naive she had been to want peace.
\space \space The Focusing Iris. It was the most brutal and cowardly killing method Jaina could imagine.
\space \space The Horde wants war. They will do anything to destroy us. But if this is all they want, Jaina will be pleased to offer them a big one.
The warships of the Horde can be described as a string ss which contains only '0' and '1', denoting the small warship and the large warship. Jaina can perform some magic to the string. In one magic, she chooses an arbitrary interval with odd length and reverse it. Jaina can perform this magic as many times as she likes.
Jaina wants the small warships to be in the front, since they are easier to destroy. She asks for your help, and you need to tell her the lexicographically smallest string that she can obtain.
Note: in this problem, suppose two sequences s and tt both have length n then ss is lexicographically smaller than t if there exists a position i(1≤i≤n) such that sj=tj for all 1≤j<i andsi=′0′,ti=′1′.
The input consists of multiple test cases.
The first line contains an integer T (1≤T≤10) denoting the number of test cases.
Each test case consists of only one line containing a string s (∣s∣≤105).
2
101001
01101100000000101010
001011
00000000001010101111