#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int p = 0; p < t; p++) {
    string s;
    cin >> s;
    if (s.size() == 1) {
      cout << s << '\n';
      continue;
    }
    map<int, int> S;
    map<int, int> O;
    for (int k = 0; k < 26; k++) {
      S[k] = 0;
      O[k] = 0;
    }
    for (int i = 0; i < s.length(); i++) {
      S[s[i] - 'a'] = 1;
      char ch = s[i];
      i++;
      int count = 1;
      while (i < s.length() && s[i] == ch) {
        count++;
        i++;
      }
      i--;
      if (count % 2 == 1) O[ch - 'a'] = 1;
    }
    for (int i = 0; i < 26; i++) {
      if (O[i] && S[i]) {
        string f = "";
        f += char('a' + i);
        cout << f;
      }
    }
    cout << '\n';
  }
  return 0;
}
