#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t) {
    long long int i = 0, n = 0, m = 0, j = 0;
    string s;
    cin >> s;
    vector<int> e, o, v;
    for (i = 0; i < s.length(); i++) {
      int a = s[i] - '0';
      if (a % 2 == 0) {
        e.push_back(a);
        n++;
      } else {
        m++;
        o.push_back(a);
      }
    }
    cout << "\n";
    i = 0;
    while (i < n && j < m) {
      if (e[i] < o[j]) {
        v.push_back(e[i]);
        i++;
      }
      if (e[i] > o[j]) {
        v.push_back(o[j]);
        j++;
      }
    }
    while (i < n) {
      v.push_back(e[i]);
      i++;
    }
    while (j < m) {
      v.push_back(o[j]);
      j++;
    }
    for (i = 0; i < (m + n); i++) {
      cout << v[i];
    }
    t--;
  }
}
