#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int n = s.size();
    vector<string> v(2);
    for (long long int i = 0; i < n; i++) v[(s[i] - '0') % 2].push_back(s[i]);
    long long int c1 = 0, c2 = 0;
    for (long long int i = 0; i < n; i++) {
      if (c1 == v[0].size())
        cout << v[1][c2++];
      else if (c2 == v[1].size())
        cout << v[0][c1++];
      else if (v[0][c1] < v[1][c2])
        cout << v[0][c1++];
      else
        cout << v[1][c2++];
    }
    cout << endl;
  }
  return 0;
}
