#include <bits/stdc++.h>
using namespace std;
int main() {
  stack<char> s;
  string str;
  int t;
  cin >> t;
  while (t--) {
    cin >> str;
    for (int i = 0; str[i + 1] != '\0'; i++) {
      if (str[i] == str[i + 1]) {
        str[i] = '.';
        str[i + 1] = '.';
        i += 1;
      }
    }
    set<char> d;
    for (int i = 0; str[i] != '\0'; i++) {
      if (str[i] >= 'a' && str[i] <= 'z') {
        d.insert(str[i]);
      }
    }
    for (auto x : d) {
      cout << x;
    }
    cout << "\n";
  }
  return 0;
}
