#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5, INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int t;
int main() {
  cin >> t;
  while (t--) {
    string ans, s;
    cin >> s;
    int now = s[0];
    int i = 1;
    while (i < s.size()) {
      int cnt = 1;
      while (now == s[i]) i++, cnt++;
      if (cnt & 1) ans.push_back(now);
      now = s[i];
      i++;
    }
    int n = s.size();
    if (s[n - 1] != s[n - 2]) ans.push_back(s[n - 1]);
    sort(ans.begin(), ans.end());
    ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
    cout << ans << endl;
  }
  return 0;
}
