#include <bits/stdc++.h>
using namespace std;
set<char> se[102];
int t;
string s;
int main() {
  cin >> t;
  for (int p = 1; p <= t; p++) {
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == s[i + 1])
        i++;
      else
        se[p].insert(s[i]);
    }
  }
  for (int i = 1; i <= t; i++) {
    while (se[i].begin() != se[i].end()) {
      cout << *se[i].begin();
      se[i].erase(*se[i].begin());
    }
    cout << endl;
  }
  return 0;
}
