#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    string s;
    cin >> s;
    string ans = "";
    string f = "";
    int i = 0;
    for (; i < s.length() - 1;) {
      if (s[i] != s[i + 1]) {
        ans += s[i];
        i++;
      } else {
        f += s[i];
        i += 2;
      }
    }
    if (i == s.length() - 1) {
      ans += s[i];
    }
    sort(ans.begin(), ans.end());
    if (ans.empty()) {
      cout << endl;
      continue;
    }
    cout << ans[0];
    for (int i = 1; i < ans.length(); i++) {
      if (ans[i] == ans[i - 1]) {
        continue;
      } else {
        cout << ans[i];
      }
    }
    cout << endl;
  }
  return 0;
}
