#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int q, n;
  cin >> q;
  while (q--) {
    string s;
    cin >> s;
    vector<int> v, v2;
    for (int i = 0; i < s.size(); i++) {
      int d = (int)s[i] - (int)'0';
      if (d % 2 == 0)
        v.push_back(d);
      else
        v2.push_back(d);
    }
    int a = 0, b = 0;
    while (1) {
      if (a == v.size() && b == v2.size()) break;
      if (a == v.size()) {
        cout << v2[b];
        b++;
      } else if (b == v2.size()) {
        cout << v[a];
        a++;
      } else if (v[a] < v2[b]) {
        cout << v[a];
        a++;
      } else if (v[a] > v2[b]) {
        cout << v2[b];
        b++;
      }
    }
    cout << endl;
  }
}
