#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    string s;
    cin >> s;
    char c = s[0];
    int len = 1;
    bool ok[26] = {};
    for (int i = 1; i < s.size(); i++) {
      if (s[i] != c) {
        if (len % 2) {
          ok[c - 'a'] = 1;
        }
        c = s[i];
        len = 1;
      } else {
        len++;
      }
    }
    if (len % 2) {
      ok[c - 'a'] = 1;
    }
    string res = "";
    for (int i = 0; i < 26; i++) {
      if (ok[i]) res += string(1, 'a' + i);
    }
    cout << res << endl;
  }
}
