#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    set<char> se;
    for (char ch : s) {
      se.insert(ch);
    }
    map<char, vector<int>> mp;
    for (auto it = se.begin(); it != se.end(); ++it) {
      char ch = *it;
      int count = 0;
      for (int i = 0; i < s.length(); i++) {
        if (s[i] == ch && i < s.length() - 1) {
          count++;
        } else if (s[i] == ch && i == s.length() - 1) {
          count++;
          mp[ch].push_back(count);
        } else {
          mp[ch].push_back(count);
          count = 0;
        }
      }
    }
    string ans = "";
    for (auto it = mp.begin(); it != mp.end(); ++it) {
      char c = it->first;
      vector<int> v = it->second;
      for (int y : v) {
        if (y % 2) {
          ans.push_back(c);
          break;
        }
      }
    }
    sort(ans.begin(), ans.end());
    cout << ans << "\n";
  }
  return 0;
}
