#include <bits/stdc++.h>
using namespace std;
int main() {
  int TC;
  cin >> TC;
  while (TC--) {
    string a;
    cin >> a;
    for (int i = 1; i < a.length(); i++)
      if (a[i] == a[i - 1]) a.erase(--i, 2);
    sort(a.begin(), a.end());
    for (int i = 1; i < a.length(); i++)
      if (a[i] == a[i - 1]) a.erase(--i, 1);
    cout << a << '\n';
  }
  return 0;
}
