#include <bits/stdc++.h>
using namespace std;
long long a[1000005], b[1000005], c[1000005][2], fq[1000005] = {0},
                                                 f[1000005] = {0}, T, TT = 1;
bool mycmp(long long x, long long y) { return (x > y); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> TT;
  for (T = 1; T <= TT; T++) {
    long long n, i, j = 0, l = 0, r, k = 0, m = 0, ans = 0, max_ele = INT_MIN,
                    min_ele = INT_MAX, sum = 0, x, y, z,
                    p = (long long)(1e9 + 7);
    string s, s1 = "", s2, s3;
    cin >> s;
    for (i = 0; i < s.size(); i++) {
      if (i == s.size() - 1) {
        s1 += s[i];
      } else if (s[i] != s[i + 1]) {
        s1 += s[i];
      } else {
        i++;
      }
    }
    int ar[26] = {0};
    for (i = 0; i < s1.size(); i++) ar[s1[i] - 'a'] = 1;
    for (i = 0; i < 26; i++) {
      if (ar[i] == 1) cout << char('a' + i);
    }
    cout << endl;
  }
  return 0;
}
