#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  vector<vector<bool>> a(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    a[i].resize(26);
  }
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (j < s[i].size() - 1) {
      if (s[i][j] != s[i][j + 1]) {
        a[i][(s[i][j] - 'a')] = 1;
        j++;
      } else {
        j = j + 2;
      }
    }
    if (j == s[i].size() - 1) {
      a[i][s[i][s[i].size() - 1] - 'a'] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 26; j++) {
      if (a[i][j] == 1) {
        cout << (char)('a' + j);
      }
    }
    cout << '\n';
  }
}
