#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int n = s.size();
    string odd = "", even = "";
    for (int i = 0; i < n; i++) {
      if (s[i] % 2)
        odd += s[i];
      else
        even += s[i];
    };
    ;
    merge(odd.begin(), odd.end(), even.begin(), even.end(), s.begin());
    cout << s << endl;
  }
}
