#include <bits/stdc++.h>
using namespace std;
int n, m;
string a;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    string b, c;
    for (int j = 0; j < a.length(); j++) {
      if (a[j] % 2) {
        b += a[j];
      } else
        c += a[j];
    }
    merge(b.begin(), b.end(), c.begin(), c.end(), a.begin());
    cout << a << endl;
  }
  return 0;
}
