#include <bits/stdc++.h>
using namespace std;
void fun(char ar[], vector<char> &e, vector<char> &o) {
  long int n = e.size();
  long int m = o.size();
  int a, b, c;
  a = b = c = 0;
  while (a < n && b < m) {
    if (o[b] < e[a]) {
      ar[c] = o[b];
      b++;
      c++;
    } else {
      ar[c] = e[a];
      a++;
      c++;
    }
  }
  while (a < n) {
    ar[c] = e[a];
    a++;
    c++;
  }
  while (b < m) {
    ar[c] = o[b];
    b++;
    c++;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long int t;
  char ar[300050];
  cin >> t;
  while (t--) {
    vector<char> o, e;
    cin >> ar;
    long int i = 0;
    while (ar[i] != '\0') {
      if ((ar[i] - '0') % 2 == 0)
        e.push_back(ar[i]);
      else
        o.push_back(ar[i]);
      i++;
    }
    fun(ar, e, o);
    for (int i = 0; ar[i] != '\0'; i++) cout << ar[i];
    cout << endl;
  }
  return 0;
}
