#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, Len, count;
  char Str[505], c;
  set<char> str;
  set<char>::iterator it;
  scanf("%d", &T);
  for (int x = 1; x <= T; x++) {
    scanf("%s", Str);
    Len = strlen(Str);
    --Len;
    c = Str[0];
    count = 1;
    for (int k = 1; k <= Len; k++) {
      if (Str[k] == c) {
        count += 1;
      } else {
        if (count % 2 != 0) {
          str.insert(c);
        }
        c = Str[k];
        count = 1;
      }
    }
    if (count % 2 != 0) {
      str.insert(c);
    }
    if (Len == 0) {
      printf("%s\n", Str);
    } else if (!str.empty()) {
      for (it = str.begin(); it != str.end(); it++) {
        cout << *it;
      }
      printf("\n");
    } else {
      printf("\n");
    }
    str.clear();
  }
  return 0;
}
