#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 1, 0, 0, -1, 1, -1, 1};
int dy[] = {0, 0, -1, 1, -1, 1, 1, -1};
const int oo = 2e9;
const int N = 1e6;
int t;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> s;
    set<char> ans;
    ans.clear();
    for (int i = 0; i < 26; i++) {
      char c = (char)(i + 'a');
      string x;
      x.push_back(c);
      x.push_back(c);
      while (s.find(x) != string::npos) {
        int f = s.find(x);
        s[f] = s[f + 1] = '.';
      }
    }
    for (char c : s)
      if (c != '.') ans.insert(c);
    for (char c : ans) cout << c;
    cout << endl;
  }
  return 0;
}
