#include <bits/stdc++.h>
long long i, j;
long long max1 = INT_MIN, min1 = INT_MAX;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    char p = s[0];
    long long count = 1;
    set<char> st;
    for (i = 1; s[i]; i++) {
      if (s[i] == p) {
        count++;
      } else {
        if (count & 1)
          st.insert(p), count = 1;
        else {
          count = 1;
        }
        p = s[i];
      }
    }
    if (count & 1) st.insert(s[i - 1]);
    for (auto x : st) cout << x;
    cout << "\n";
  }
  return 0;
}
