#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    string a;
    cin >> a;
    map<char, bool> mp1;
    map<char, long long> mp2;
    string res = "";
    long long n = a.length();
    long long i = 0;
    while (i < n) {
      if (i + 1 < n && a[i] == a[i + 1]) {
        if (mp1.count(a[i]) == 0) {
          mp1[a[i]] = true;
        }
        mp2[a[i]] += 2;
        i++;
      } else {
        mp1[a[i]] = false;
        mp2[a[i]]++;
      }
      i++;
    }
    for (auto it : mp2) {
      if (mp1[it.first] == false) {
        res += it.first;
      } else {
        if (it.second % 2 == 1) {
          res += it.first;
        }
      }
    }
    cout << res << endl;
  }
  cin.clear();
  cin.get();
  return 0;
}
