#include <bits/stdc++.h>
using namespace std;
long long modpow(long long base, long long exp, long long modulus) {
  base %= modulus;
  long long result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    string second;
    cin >> second;
    map<char, int> m;
    string ss = "";
    int c = 1;
    for (int i = 0; i < second.length(); i++) {
      if (second[i] == second[i + 1])
        c++;
      else {
        if (m[second[i]] == 0) {
          if (c % 2) {
            ss += second[i];
            m[second[i]] = 1;
          }
        }
        c = 1;
      }
    }
    sort(ss.begin(), ss.end());
    cout << ss << "\n";
  }
  return false;
}
