#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(0) << fixed;
  int t;
  cin >> t;
  string s;
  while (t--) {
    cin >> s;
    set<char> st;
    for (int i = 0; i < (s).size(); i++) {
      int c = 1;
      while (s[i] == s[i + 1]) {
        c++;
        i++;
      }
      if (c % 2 != 0) st.insert(s[i]);
    }
    for (auto i : st) cout << i;
    cout << "\n";
  }
}
