#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s1, s2 = "";
    cin >> s1;
    int sz = s1.size();
    for (int i = 0; i < sz; i++) {
      if (s1[i] == s1[i + 1]) {
        i++;
        continue;
      } else {
        s2 += s1[i];
      }
    }
    sort(s2.begin(), s2.end());
    int sz2 = s2.size();
    for (int i = 0; i < sz2; i++) {
      if (s2[i] == s2[i + 1]) continue;
      cout << s2[i];
    }
    cout << endl;
    s2 = "";
  }
}
