#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  string str;
  cin >> t;
  while (t--) {
    cin >> str;
    set<char> res;
    set<char>::iterator it;
    for (int i = 1; i < str.size(); i++) {
      if (str[i] == str[i - 1]) {
        str[i] = '-';
        str[i - 1] = '-';
      }
    }
    for (int i = 0; i < str.size(); i++) {
      if (str[i] != '-') res.insert(str[i]);
    }
    for (it = res.begin(); it != res.end(); it++) cout << *it;
    cout << endl;
  }
  return 0;
}
