#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    set<char> ans;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] != s[i + 1])
        ans.insert(s[i]);
      else
        i++;
    }
    for (auto i : ans) cout << i;
    cout << "\n";
  }
  return 0;
}
