#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int q, n;
  string s;
  cin >> q;
  while (q--) {
    cin >> s;
    n = s.length();
    string e, o;
    for (int i = 0; i < n; i++) {
      if ((s[i] - '0') % 2)
        o.push_back(s[i]);
      else
        e.push_back(s[i]);
    }
    for (int i = 0, j = 0, k = 0; k < n; k++) {
      if (i == o.length() || (j != e.length() && e[j] < o[i]))
        s[k] = e[j++];
      else
        s[k] = o[i++];
    }
    cout << s << endl;
  }
  return 0;
}
