#include <bits/stdc++.h>
const long long M = 1e9 + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < 26; j++) {
      for (long long k = 0; k < s.length(); k++) {
        long long c = 0, flag = 0;
        while (s[k] == ('a' + j) && k < s.length()) {
          flag = 1;
          c++;
          k++;
        }
        if (flag == 1) k--;
        if (c % 2 == 1) {
          cout << (char)('a' + j);
          break;
        }
      }
    }
    cout << "\n";
  }
  return 0;
}
