#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int powz(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) res = (res * 1ll * a) % mod;
    b /= 2;
    a = (a * 1ll * a) % mod;
  }
  return res;
}
void add(int& a, int b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}
int mul(int a, int b) { return (a * 1ll * b) % mod; }
template <typename A, typename B>
istream& operator>>(istream& input, pair<A, B>& x) {
  input >> x.first >> x.second;
  return input;
}
template <typename A>
istream& operator>>(istream& input, vector<A>& x) {
  for (auto& i : x) input >> i;
  return input;
}
template <typename A>
ostream& operator<<(ostream& output, vector<A>& x) {
  for (auto& i : x) output << i << ' ';
  return output;
}
void solve() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    string ans = "";
    int i;
    for (i = 0; i < s.length() - 1; i++) {
      if (s[i] == s[i + 1]) {
        i++;
      } else {
        ans += s[i];
      }
    }
    if (i == s.length() - 1) ans += s[i];
    int hash[26] = {0};
    for (int i = 0; i < ans.length(); i++) {
      hash[ans[i] - 'a'] = 1;
    }
    for (i = 0; i <= 25; i++) {
      if (hash[i] == 1) cout << (char)(i + 'a');
    }
    cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  solve();
}
