#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      a[i] = s[i] - '0';
    }
    vector<int> o, e;
    for (int x : a) {
      if (x % 2 == 1)
        o.push_back(x);
      else
        e.push_back(x);
    }
    int i = 0, j = 0;
    int n1 = e.size(), n2 = o.size();
    while (i < n1 && j < n2) {
      while (e[i] < o[j] && i < n1) {
        cout << e[i];
        i++;
      }
      if (i == n) break;
      while (o[j] < e[i] && j < n2) {
        cout << o[j];
        j++;
      }
    }
    for (int k = i; k < n1; k++) {
      cout << e[k];
    }
    for (int k = j; k < n2; k++) {
      cout << o[k];
    }
    cout << "\n";
  }
  return 0;
}
