#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 2e5 + 1;
void solve() {
  string s, even, odd;
  cin >> s;
  for (long long int i = 0; i < s.length(); i++) {
    long long int val = s[i] - '0';
    if (val % 2 == 0)
      even += s[i];
    else
      odd += s[i];
  }
  if (odd.length() == 0) {
    cout << even << "\n";
  } else if (even.length() == 0) {
    cout << odd << "\n";
  } else {
    long long int n1 = odd.length(), n2 = even.length();
    long long int i = 0, j = 0;
    while (i < n1 && j < n2) {
      if (odd[i] < even[j]) {
        cout << odd[i];
        i++;
      } else if (odd[i] > even[j]) {
        cout << even[j];
        j++;
      } else {
        cout << odd[i] << even[j];
        i++;
        j++;
      }
    }
    while (i < n1) {
      cout << odd[i];
      i++;
    }
    while (j < n2) {
      cout << even[j];
      j++;
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1, p = 0;
  cin >> T;
  do {
    solve();
    p++;
  } while (p < T);
  return 0;
}
