#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    string a;
    cin >> a;
    int n = a.size();
    set<char> ans;
    for (int i = 0; i < n; i++) {
      if (i == n - 1 or a[i] != a[i + 1]) {
        ans.insert(a[i]);
      } else {
        i++;
      }
    }
    for (auto it : ans) {
      cout << it;
    }
    cout << "\n";
  }
}
