#include <bits/stdc++.h>
using namespace std;
string s;
int t, i;
char ch[505];
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    int n = s.length() - 1;
    int i = 0, q = 0;
    int dem = 1;
    while (i <= n) {
      if (s[i] == s[i + 1]) {
        dem++;
        i++;
      } else {
        if (dem % 2 != 0) {
          q++;
          ch[q] = s[i];
          dem = 1;
          i++;
        } else {
          dem = 1;
          i++;
        }
      }
    }
    sort(ch + 1, ch + 1 + q);
    i = 1;
    while (i <= q) {
      if (ch[i] != ch[i + 1]) {
        cout << ch[i];
        i++;
      } else
        i++;
    }
    memset(ch, 0, sizeof(ch));
    cout << '\n';
  }
}
