#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    string s;
    cin >> s;
    int l = s.size();
    set<char> c;
    int p;
    for (int j = 0; j < l; j = j + p) {
      if (s[j] == s[j + 1]) {
        p = 2;
      } else {
        c.insert(s[j]);
        p = 1;
      }
    }
    for (auto it = c.begin(); it != c.end(); ++it) {
      cout << *it;
    }
    cout << endl;
  }
  return 0;
}
