#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    string s;
    cin >> s;
    vector<char> v[2];
    for (int i = 0; i < s.size(); i++) v[s[i] % 2].push_back(s[i]);
    int p1, p2;
    for (p1 = 0, p2 = 0; p1 < v[0].size() && p2 < v[1].size();) {
      if (v[0][p1] < v[1][p2])
        cout << v[0][p1++];
      else
        cout << v[1][p2++];
    }
    while (p1 < v[0].size()) cout << v[0][p1++];
    while (p2 < v[1].size()) cout << v[1][p2++];
    cout << '\n';
  }
  return 0;
}
