import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class P_1251A {
    static final FS sc = new FS();
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        int t = sc.nextInt();
        while(t-->0){
            char[] c = sc.next().toCharArray();
            int n = c.length;
            int[] a = new int[26];
            for(int i=0; i<n; i++){
                int j = i;
                while(j+1<n && c[j+1]==c[i]){
                    j++;
                }
                if((j-i)%2==0) a[c[i]-'a'] = 1;
                i = j;
            }
            StringBuilder sb = new StringBuilder();
            sb.append("");
            for(int i=0; i<26; i++){
                if(a[i]==1) sb.append((char)('a'+i));
            }
            System.out.println(sb.toString());
        }
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception ignored) {
                }
            }
            return st.nextToken();
        }

        int[] nextArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.util.Scanner;

public class Solution1251A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        sc.nextLine();
        while (t-- > 0) {
            String s = sc.nextLine();
            boolean[] alphabet = new boolean[26];
            char currChar = s.charAt(0);
            int currCount = 1;
            for (int i = 1; i < s.length(); i++) {
                if (s.charAt(i) == currChar) {
                    currCount++;
                } else {
                    if (currCount % 2 != 0) {
                        alphabet[currChar - 'a'] = true;
                    }
                    currChar = s.charAt(i);
                    currCount = 1;
                }
            }
            if (currCount % 2 != 0) {
                alphabet[currChar - 'a'] = true;
            }
            for (int i = 0; i < 26; i++) {
                if (alphabet[i]) {
                    System.out.print(Character.toString((char) i + 'a'));
                }
            }
            System.out.println();
        }
    }
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		sc.nextLine();
		for(int i=0;i<t;i++) {
			String seq=sc.nextLine();
			Queue<String> order=new PriorityQueue<>();
			Map<String,Integer> cont=new HashMap<>();
			if(seq.length()==1) {
				System.out.print(seq);
				System.out.println();
			}
			else{
				for(int j=0;j<seq.length();j++) {
					if(j==seq.length()-1) {
						order.add(String.valueOf(seq.charAt(j)));
					}
					else if(String.valueOf(seq.charAt(j)).equals(String.valueOf(seq.charAt(j+1)))) {
						j=j+1;
						continue;
					}
					else {
						if(!(cont.containsKey(String.valueOf(seq.charAt(j))))) {
							order.add(String.valueOf(seq.charAt(j)));
							cont.put(String.valueOf(seq.charAt(j)),1);
						}
					}
				}
				for(String x:order) {
					System.out.print(x);
				}
				System.out.println();
			}
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		sc.nextLine();
		for(int i=0;i<t;i++) {
			String seq=sc.nextLine();
			Queue<String> order=new PriorityQueue<>();
			Map<String,Integer> cont=new HashMap<>();
			if(seq.length()==1) {
				System.out.print(seq);
				System.out.println();
			}
			else{
				for(int j=0;j<seq.length();j++) {
					if(j==seq.length()-1) {
						order.add(String.valueOf(seq.charAt(j)));
					}
					else if(String.valueOf(seq.charAt(j)).equals(String.valueOf(seq.charAt(j+1)))) {
						j=j+1;
						continue;
					}
					else {
						if(!(cont.containsKey(String.valueOf(seq.charAt(j))))) {
							order.add(String.valueOf(seq.charAt(j)));
							cont.put(String.valueOf(seq.charAt(j)),1);
						}
					}
				}
				int s=order.size();
				for(int j=0;j<s;j++) {
					System.out.print(order.poll());
				}
				System.out.println();
			}
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		sc.nextLine();
		for(int i=0;i<t;i++) {
			String seq=sc.nextLine();
			Queue<String> order=new PriorityQueue<>();
			Map<String,Integer> cont=new HashMap<>();
			if(seq.length()==1) {
				System.out.print(seq);
				System.out.println();
			}
			else{
				for(int j=0;j<seq.length();j++) {
					if(j==seq.length()-1) {
						if(!(cont.containsKey(String.valueOf(seq.charAt(j))))) {
							order.add(String.valueOf(seq.charAt(j)));
							cont.put(String.valueOf(seq.charAt(j)),1);
						}
					}
					else if(String.valueOf(seq.charAt(j)).equals(String.valueOf(seq.charAt(j+1)))) {
						j=j+1;
						continue;
					}
					else {
						if(!(cont.containsKey(String.valueOf(seq.charAt(j))))) {
							order.add(String.valueOf(seq.charAt(j)));
							cont.put(String.valueOf(seq.charAt(j)),1);
						}
					}
				}
				int s=order.size();
				for(int j=0;j<s;j++) {
					System.out.print(order.poll());
				}
				System.out.println();
			}
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		sc.nextLine();
		for(int i=0;i<t;i++) {
			String seq=sc.nextLine();
			Queue<String> order=new PriorityQueue<>();
			if(seq.length()==1) {
				System.out.print(seq);
				System.out.println();
			}
			else{
				for(int j=0;j<seq.length();j++) {
					if(j==seq.length()-1) {
						order.add(String.valueOf(seq.charAt(j)));
					}
					else if(String.valueOf(seq.charAt(j)).equals(String.valueOf(seq.charAt(j+1)))) {
						j=j+1;
						continue;
					}
					else {
						order.add(String.valueOf(seq.charAt(j)));
					}
				}
				for(String x:order) {
					System.out.print(x);
				}
				System.out.println();
			}
		}
	}
}


import java.util.*;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		sc.nextLine();
		for(int i=0;i<t;i++) {
			String seq=sc.nextLine();
			Queue<String> order=new PriorityQueue<>();
			Map<String,Integer> cont=new HashMap<>();
			if(seq.length()==1) {
				System.out.print(seq);
				System.out.println();
			}
			else{
				for(int j=0;j<seq.length();j++) {
					if(j==seq.length()-1) {
						order.add(String.valueOf(seq.charAt(j)));
					}
					else if(String.valueOf(seq.charAt(j)).equals(String.valueOf(seq.charAt(j+1)))) {
						j=j+1;
						continue;
					}
					else {
						if(!(cont.containsKey(String.valueOf(seq.charAt(j))))) {
							order.add(String.valueOf(seq.charAt(j)));
							cont.put(String.valueOf(seq.charAt(j)),1);
						}
					}
				}
				for(int j=0;j<order.size();j++) {
					System.out.print(order.poll());
				}
				System.out.println();
			}
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.stream.Stream;
import java.util.Collection;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.InputStream;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABrokenKeyboard solver = new ABrokenKeyboard();
        int testCount = Integer.parseInt(in.next());
        for (int i = 1; i <= testCount; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class ABrokenKeyboard {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            List<Integer>[] occ = Graphs.createGraph(26);
            char[] s = in.nextCharArray();
            for (int i = 0; i < s.length; ++i) {
                int count = 0;
                int j = i;
                while (j < s.length && s[j] == s[i]) {
                    ++j;
                    ++count;
                }
                occ[s[i] - 'a'].add(count);
                i = j - 1;
            }
            for (int i = 0; i < 26; ++i) {
                if (occ[i].isEmpty()) continue;
                boolean ok = occ[i].stream().anyMatch(e -> e % 2 == 1);
                if (ok) out.print((char) (i + 'a'));
            }
            out.println();
        }

    }

    static class InputReader {
        private InputStream stream;
        private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
        private static final int EOF = -1;
        private byte[] buf = new byte[DEFAULT_BUFFER_SIZE];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (this.numChars == EOF) {
                throw new UnknownError();
            } else {
                if (this.curChar >= this.numChars) {
                    this.curChar = 0;

                    try {
                        this.numChars = this.stream.read(this.buf);
                    } catch (IOException ex) {
                        throw new InputMismatchException();
                    }

                    if (this.numChars <= 0) {
                        return EOF;
                    }
                }

                return this.buf[this.curChar++];
            }
        }

        public String next() {
            int c;
            while (isSpaceChar(c = this.read())) {
            }

            StringBuilder result = new StringBuilder();
            result.appendCodePoint(c);

            while (!isSpaceChar(c = this.read())) {
                result.appendCodePoint(c);
            }

            return result.toString();
        }

        public static boolean isSpaceChar(int c) {
            return c == 32 || c == 10 || c == 13 || c == 9 || c == EOF;
        }

        public char[] nextCharArray() {
            return next().toCharArray();
        }

    }

    static abstract class Graphs {
        public static List<Integer>[] createGraph(int n) {
            List<Integer>[] res = new ArrayList[n];
            for (int i = 0; i < n; ++i) {
                res[i] = new ArrayList<>();
            }
            return res;
        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class A_1251 {
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = Integer.parseInt(sc.nextLine());
        String [] allRes = new String [n];
        for(int i = 0; i < n; ++i){
            String line = sc.nextLine();
            int len = line.length();
            if(len == 1){
                allRes[i] = line;
                System.out.println(line);
            }
            else if(len == 0){
                allRes[i] = "";
                System.out.println("");
            }
            else{
                StringBuilder sb = new StringBuilder();
                int pos = 0;
                while(pos < line.length() - 1){
                    if(line.charAt(pos) == line.charAt(pos + 1)){
                        ++pos;
                    }else{
                        char candidate = line.charAt(pos);
                        if(sb.indexOf(String.valueOf(candidate)) == -1){
                            sb.append(candidate);
                        }
                    }
                    ++pos;
                }
                pos = line.length() -1;
                if(sb.indexOf(String.valueOf(line.charAt(pos))) == -1){
                    int seq = 1;
                    char lastLetter = line.charAt(pos);
                    --pos;
                    while(pos >= 0 && line.charAt(pos) == lastLetter){
                        ++seq;
                        --pos;
                    }

                    if(seq % 2 == 1 ){
                        sb.append(lastLetter);
                    }
                }

                char [] letters = sb.toString().toCharArray();
                Arrays.sort(letters);

                allRes[i] = new String(letters);
                System.out.println(letters);
            }
        }
        for (String res: allRes) {
            System.out.println(res);
        }
    }
}


package A;

import java.util.Arrays;
import java.util.Scanner;

public class A_1251 {
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = Integer.parseInt(sc.nextLine());
        String [] allRes = new String [n];
        for(int i = 0; i < n; ++i){
            String line = sc.nextLine();
            int len = line.length();
            if(len == 1){
                allRes[i] = line;
            }
            else if(len == 0){
                allRes[i] = "";
            }
            else{
                StringBuilder sb = new StringBuilder();
                int pos = 0;
                while(pos < line.length() - 1){
                    if(line.charAt(pos) == line.charAt(pos + 1)){
                        ++pos;
                    }else{
                        char candidate = line.charAt(pos);
                        if(sb.indexOf(String.valueOf(candidate)) == -1){
                            sb.append(candidate);
                        }
                    }
                    ++pos;
                }
                pos = line.length() -1;
                if(sb.indexOf(String.valueOf(line.charAt(pos))) == -1){
                    int seq = 1;
                    char lastLetter = line.charAt(pos);
                    --pos;
                    while(pos >= 0 && line.charAt(pos) == lastLetter){
                        ++seq;
                        --pos;
                    }

                    if(seq % 2 == 1 ){
                        sb.append(lastLetter);
                    }
                }

                char [] letters = sb.toString().toCharArray();
                Arrays.sort(letters);

                allRes[i] = new String(letters);
            }
        }
        for (String res: allRes) {
            System.out.println(res);
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class A_1251 {
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = Integer.parseInt(sc.nextLine());
        String [] allRes = new String [n];
        for(int i = 0; i < n; ++i){
            String line = sc.nextLine();
            int len = line.length();
            if(len == 1){
                allRes[i] = line;
            }
            else if(len == 0){
                allRes[i] = "";
            }
            else{
                StringBuilder sb = new StringBuilder();
                int pos = 0;
                while(pos < line.length() - 1){
                    if(line.charAt(pos) == line.charAt(pos + 1)){
                        ++pos;
                    }else{
                        char candidate = line.charAt(pos);
                        if(sb.indexOf(String.valueOf(candidate)) == -1){
                            sb.append(candidate);
                        }
                    }
                    ++pos;
                }
                pos = line.length() -1;
                if(sb.indexOf(String.valueOf(line.charAt(pos))) == -1){
                    int seq = 1;
                    char lastLetter = line.charAt(pos);
                    --pos;
                    while(pos >= 0 && line.charAt(pos) == lastLetter){
                        ++seq;
                        --pos;
                    }

                    if(seq % 2 == 1 ){
                        sb.append(lastLetter);
                    }
                }

                char [] letters = sb.toString().toCharArray();
                Arrays.sort(letters);

                allRes[i] = new String(letters);
            }
        }
        for (String res: allRes) {
            System.out.println(res);
        }
    }
}


import java.util.Arrays;
import java.util.Scanner;

public class A_1251 {
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int n = Integer.parseInt(sc.nextLine());
        String [] allRes = new String [n];
        for(int i = 0; i < n; ++i){
            String line = sc.nextLine();
            int len = line.length();
            if(len == 1){
                allRes[i] = line;
            }
            else if(len == 0){
                allRes[i] = "";
            }
            else{
                StringBuilder sb = new StringBuilder();
                int pos = 0;
                while(pos < line.length() - 1){
                    if(line.charAt(pos) == line.charAt(pos + 1)){
                        ++pos;
                    }else{
                        char candidate = line.charAt(pos);
                        if(sb.indexOf(String.valueOf(candidate)) == -1){
                            sb.append(candidate);
                        }
                    }
                    ++pos;
                }
                if(line.charAt(len - 1) != line.charAt(len - 2)){
                    sb.append(line.charAt(len - 1));
                }
                char [] letters = sb.toString().toCharArray();
                Arrays.sort(letters);

                allRes[i] = new String(letters);
            }
        }
        for (String res: allRes) {
            System.out.println(res);
        }
    }
}


import java.util.*;
import java.io.*;
public class A75
{
    public static void main(String [] args)
    {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = sc.nextInt();
        while (t > 0) {
            String s = sc.next(); TreeSet<Character> ans = new TreeSet<>(); int i = 0;
            while (i < s.length()) {
                if (i != s.length() - 1 && s.charAt(i) == s.charAt(i + 1)) {
                    i += 2;
                } else {
                    ans.add(s.charAt(i));
                    i += 1;
                }
            }

            for (Character p : ans) out.print(p);
            out.println();
            t--;
        }

        out.close();
    }

    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}


import java.util.*;
import java.io.*;

public class Test {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int t = in.nextInt();
        for( ; t > 0 ; t--) {
            String s = in.nextLine();
            int[] answer = new int[26];
            answer[s.charAt(0) - 'a'] = 1;
            if(s.length() > 1 && s.charAt(1) != s.charAt(0))
                answer[s.charAt(0) - 'a'] = 2;
            for(int i = 1 ; i < s.length() ; i++) {
                char currentChar = s.charAt(i);
                char prevChar = s.charAt(i - 1);
                if(answer[currentChar - 'a'] == 2)
                    continue;
                if(currentChar == prevChar) {
                    if(answer[currentChar - 'a'] == 1)
                        answer[currentChar - 'a'] = 0;
                    else
                        answer[currentChar - 'a'] = 1;
                }
                else if(i < s.length() - 1 && currentChar != s.charAt(i + 1))
                    answer[currentChar - 'a'] = 2;
                else
                    answer[currentChar - 'a'] = 1;
            }
            for(int i = 0 ; i < 26 ; i++) {
                if(answer[i] != 0)
                    System.out.print((char)(i + 'a'));
            }
            System.out.println();
        }
    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nIArr(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public long[] nLArr(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;
import java.io.*;

public class Test {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int t = in.nextInt();
        for( ; t > 0 ; t--) {
            String s = in.nextLine();
            int[] answer = new int[26];
            answer[s.charAt(0) - 'a'] = 1;
            if(s.length() > 1 && s.charAt(1) != s.charAt(0))
                answer[s.charAt(0) - 'a'] = 2;
            for(int i = 1 ; i < s.length() ; i++) {
                char currentChar = s.charAt(i);
                char prevChar = s.charAt(i - 1);
                if(answer[currentChar - 'a'] == 2)
                    continue;
                if(currentChar == prevChar) {
                    if(answer[currentChar - 'a'] == 1)
                        answer[currentChar - 'a'] = 0;
                    else if(answer[currentChar - 'a'] == 0 && i < s.length() - 1 && currentChar != s.charAt(i + 1))
                        answer[currentChar - 'a'] = 2;
                    else
                        answer[currentChar - 'a'] = 1;
                }
                else if(i < s.length() - 1 && currentChar != s.charAt(i + 1))
                    answer[currentChar - 'a'] = 2;
                else
                    answer[currentChar - 'a'] = 1;
            }
            for(int i = 0 ; i < 26 ; i++) {
                if(answer[i] != 0)
                    System.out.print((char)(i + 'a'));
            }
            System.out.println();
        }
    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nIArr(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public long[] nLArr(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;
import java.io.*;

public class Test {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int t = in.nextInt();
        for( ; t > 0 ; t--) {
            String s = in.nextLine();
            int[] answer = new int[26];
            answer[s.charAt(0) - 'a'] = 1;
            if(s.length() > 1 && s.charAt(1) != s.charAt(0))
                answer[s.charAt(0) - 'a'] = 2;
            for(int i = 1 ; i < s.length() ; i++) {
                char currentChar = s.charAt(i);
                char prevChar = s.charAt(i - 1);
                if(answer[currentChar - 'a'] == 2)
                    continue;
                if(currentChar == prevChar) {
                    if(answer[currentChar - 'a'] == 1)
                        answer[currentChar - 'a'] = 0;
                    else if(answer[currentChar - 'a'] == 0 && currentChar != s.charAt(i + 1) && i < s.length() - 1)
                        answer[currentChar - 'a'] = 2;
                    else
                        answer[currentChar - 'a'] = 1;
                }
                else if(i < s.length() - 1 && currentChar != s.charAt(i + 1))
                    answer[currentChar - 'a'] = 2;
                else
                    answer[currentChar - 'a'] = 1;
            }
            for(int i = 0 ; i < 26 ; i++) {
                if(answer[i] != 0)
                    System.out.print((char)(i + 'a'));
            }
            System.out.println();
        }
    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nIArr(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public long[] nLArr(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
     public static void main (String[] args) throws java.lang.Exception
     {
     	Scanner in =new Scanner(System.in);
		int t,n,i,j,m=0,k,p=0,x,d,y;
		String s,r;
		t=in.nextInt();
		for(i=0;i<t;i++)
		{
		    s=in.next();r="";
		    x=s.length();
		    char c[]=s.toCharArray();
		    for(j=0;j<x;j++)
		    {
		         if(j!=x-1 && c[j]==c[j+1])
		         j++;
		         else r=r+c[j];
		    }
		    if(r.equals(""))
		    r=r+" ";
		    char ch[]=r.toCharArray();
		    Arrays.sort(ch);
		    n=r.length();
		    for(j=0;j<n-1;j++)
		    {
		         if(ch[j]!=ch[j+1])
		         System.out.print(ch[j]);
		    }
		    System.out.println(ch[n-1]);
		}
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Day_12 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		while(t--!=0) {
		String str=sc.next();
		ArrayList<Character> list=new ArrayList<Character>();
 		HashMap<Character,Integer> map=new HashMap<Character, Integer>();
		for(int i=0;i<str.length();) {
			if(i+1<str.length()) {
				if(str.charAt(i)==str.charAt(i+1)) {
					i=i+2;
				}
				else {
					if(!map.containsKey(str.charAt(i))) {
						map.put(str.charAt(i),1);
						list.add(str.charAt(i));
					}
				i++;
				}
			}
			else {
				if(!map.containsKey(str.charAt(i))) {
					map.put(str.charAt(i),1);
					list.add(str.charAt(i));
				}
			i++;
			}
		}
      Collections.sort(list);
      for(int i=0;i<list.size();i++) {
    	  System.out.print(list.get(i));
      }
      System.out.println();

	}
	}
}


import java.util.Scanner;
import java.util.TreeSet;

public class c {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        for (int i = 0; i < t; i++) {
            char[] str = scanner.next().toCharArray();
            for (int j = 1; j < str.length; j++) {
                if (str[j]==str[j-1]){
                    str[j-1] = '$';
                    str[j] = '$';
                }
            }
            TreeSet<Character> set = new TreeSet<>();
            for (char c: str) {
                if (c!='$'){
                    set.add(c);
                }
            }
            for (char c : set){
                System.out.print(c);
            }
            System.out.print("\n");
        }
    }
}


/*package whatever //do not write package name here */

import java.util.*;

public class GFG {
	public static void main (String[] args) {
// 		System.out.println("GfG!");

         Scanner s=new Scanner(System.in);
         int q=s.nextInt();
         while(q-->0)
         {
             String a=s.next();
             int b[]=new int[256];

             for(int i=1;i<a.length()-1;i++)
             {
                 if(a.charAt(i+1)!=a.charAt(i)&&a.charAt(i-1)!=a.charAt(i))
                 {
                     b[a.charAt(i)]=1;
                 }
             }

            //  if(a.length()==1)
            //  {
            //      System.out.println(a);

            //  }
             if(a.length()>1)
             {
             if(a.charAt(0)!=a.charAt(1))
             b[a.charAt(0)]=1;

             if(a.charAt(a.length()-1)!=a.charAt(a.length()-2))
             b[a.charAt(a.length()-1)]=1;
             }
             String c="";
             for(int i=0;i<256;i++)
             {
                 if(b[i]==1)
                 c+=(char)i;
             }
             if(a.length()==1)
             {
                 System.out.println(a);
             }
             else
             System.out.println(c);
         }
	}
}


/*package whatever //do not write package name here */

import java.util.*;

public class GFG {
	public static void main (String[] args) {
// 		System.out.println("GfG!");

         Scanner s=new Scanner(System.in);
         int q=s.nextInt();
         while(q-->0)
         {
             String a=s.next();
             int b[]=new int[256];

             for(int i=0;i<a.length();)
             {
                //  if(a.charAt(i+1)!=a.charAt(i)&&a.charAt(i-1)!=a.charAt(i))
                //  {
                //      b[a.charAt(i)]=1;
                //  }
                 char e=a.charAt(i);
                 int j=i,w=0;
                 while(i<a.length()&&e==a.charAt(j))
                 {
                     i++;
                     if(i<a.length())
                     {e=a.charAt(i);}
                    //  j++;
                     w++;//}
                    //  System.out.println(w);
                    //  i++;
                 }
                //  System.out.println(w);
                //  i=j;
                 if(w%2!=0)
                 {
                     b[a.charAt(j)]=1;
                 }
             }

            //  if(a.length()==1)
            //  {
            //      System.out.println(a);

            //  }
            //  if(a.length()>1)
            //  {
            //  if(a.charAt(0)!=a.charAt(1))
            //  b[a.charAt(0)]=1;

            //  if(a.charAt(a.length()-1)!=a.charAt(a.length()-2))
            //  b[a.charAt(a.length()-1)]=1;
            //  }
             String c="";
             for(int i=0;i<256;i++)
             {
                 if(b[i]==1)
                 c+=(char)i;
                //  System.out.println(b[i]);
             }
            //  if(a.length()==1)
            //  {
            //      System.out.println(a);
            //  }
            //  else
             System.out.println(c);
         }
	}
}


package first;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                System.out.println(string.charAt(0));
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    System.out.println(string);
                } else {
                    System.out.println("");
                }
                continue;
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = '\uffff';
                    chars[j] = '\uffff';
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != '\uffff'){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            System.out.println(sb.toString());
        }
    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        List<String> resOut = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                resOut.add(string);
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    resOut.add(string);
                } else {
                    resOut.add("");
                }
                continue;
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = '\uffff';
                    chars[j] = '\uffff';
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != '\uffff'){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            resOut.add(sb.toString());
        }
        for (String s : resOut) {
            System.out.println(s);
        }
    }
}


package first;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                System.out.println(string.charAt(0));
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    System.out.println(string);
                } else {
                    System.out.println();
                }
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = 0;
                    chars[j] = 0;
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != 0){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            System.out.println(sb.toString());
        }
    }
}


package first;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                System.out.println(string.charAt(0));
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    System.out.println(string);
                } else {
                    System.out.println("");
                }
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = 'Z';
                    chars[j] = 'Z';
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != 'Z'){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            System.out.println(sb.toString());
        }
    }
}


package first;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        List<String> resOut = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                resOut.add(string);
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    resOut.add(string);
                } else {
                    resOut.add("");
                }
                continue;
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = '\uffff';
                    chars[j] = '\uffff';
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != '\uffff'){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            resOut.add(sb.toString());
        }
        for (String s : resOut) {
            System.out.println(s);
        }
    }
}


package first;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < count; i++) {
            String string = scanner.nextLine();
            if (string.length() == 1) {
                System.out.println(string.charAt(0));
                continue;
            }
            if (string.length() == 2) {
                if (string.charAt(0) != string.charAt(1)) {
                    System.out.println(string);
                } else {
                    System.out.println("");
                }
            }
            char[] chars = string.toCharArray();
            for (int j = 1; j < chars.length; j++) {
                if(chars[j - 1] == chars[j]){
                    chars[j-1] = '\uffff';
                    chars[j] = '\uffff';
                }
            }
            Set<Character> result = new TreeSet<>();
            for (char aChar : chars) {
                if(aChar != '\uffff'){
                    result.add(aChar);
                }
            }
            StringBuilder sb = new StringBuilder();
            for (Character character : result) {
                sb.append(character);
            }
            System.out.println(sb.toString());
        }
    }
}


import java.util.*;
import java.io.*;
//Captain on duty!

public class Main {

    static void compare(Main.pair a[], int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }

    public static boolean checkPalindrome(String s) {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable {
        int f;
        int s;

        pair(int fi, int se) {
            f = fi;
            s = se;
        }

        public int compareTo(Object o)//desc order
        {
            pair pr = (pair) o;
            if (s > pr.s)
                return -1;
            if (s == pr.s) {
                if (f > pr.f)
                    return 1;
                else
                    return -1;
            } else
                return 1;
        }

        public boolean equals(Object o) {
            pair ob = (pair) o;
            if (o != null) {
                if ((ob.f == this.f) && (ob.s == this.s))
                    return true;
            }
            return false;
        }

        public int hashCode() {
            return (this.f + " " + this.s).hashCode();
        }

    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }

    public static long gcd(long a, long b) {
        if (b == 0)
            return a;

        return gcd(b, a % b);
    }
    public static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static long hcf(long a, long b) {
        long t;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i <= Math.sqrt(n) + 1; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str) {
        String str1 = "";
        for (int i = 0; i < str.length(); i++) {
            str1 = str1 + str.charAt(str.length() - i - 1);
        }
        return str1;
    }

    public static double fact(long a) {
        if (a == 1)
            return 1;
        else
            return a * fact(a - 1);
    }

    static boolean isPerfectSquare(double x)
    {

        // Find floating point value of
        // square root of x.
        double sr = Math.sqrt(x);

        // If square root is an integer
        return ((sr - Math.floor(sr)) == 0);
    }

    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        //System.out.println("Forces Babyy!!");

          int test=s.nextInt();
          while(test-->0)
          {
              String str=s.next();
              ArrayList<Character> l =new ArrayList<>();
              for(int i=0;i<str.length();i++)
              {
                  if(!l.contains(str.charAt(i)))
                      l.add(str.charAt(i));
              }

              String ans="";
              for(int i=0;i<str.length();i++)
              {
                  if(i<str.length()-1 && str.charAt(i)==str.charAt(i+1))
                      i++;
                  else
                      ans = ans+str.charAt(i);
              }
              char[] ch=ans.toCharArray();
              Arrays.sort(ch);
              ArrayList l1=new ArrayList();
              for(int i=0;i<ch.length;i++)
              {
                  if(!l1.contains(ch[i]))
                      l1.add(ch[i]);
              }
              for(int i=0;i<l1.size();i++)
                  System.out.print(l.get(i));
              System.out.println();

          }

    }
}


import java.util.*;
import java.io.*;
//Captain on duty!

public class Main {

    static void compare(Main.pair a[], int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }

    public static boolean checkPalindrome(String s) {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable {
        int f;
        int s;

        pair(int fi, int se) {
            f = fi;
            s = se;
        }

        public int compareTo(Object o)//desc order
        {
            pair pr = (pair) o;
            if (s > pr.s)
                return -1;
            if (s == pr.s) {
                if (f > pr.f)
                    return 1;
                else
                    return -1;
            } else
                return 1;
        }

        public boolean equals(Object o) {
            pair ob = (pair) o;
            if (o != null) {
                if ((ob.f == this.f) && (ob.s == this.s))
                    return true;
            }
            return false;
        }

        public int hashCode() {
            return (this.f + " " + this.s).hashCode();
        }

    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }

    public static long gcd(long a, long b) {
        if (b == 0)
            return a;

        return gcd(b, a % b);
    }
    public static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static long hcf(long a, long b) {
        long t;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i <= Math.sqrt(n) + 1; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str) {
        String str1 = "";
        for (int i = 0; i < str.length(); i++) {
            str1 = str1 + str.charAt(str.length() - i - 1);
        }
        return str1;
    }

    public static double fact(long a) {
        if (a == 1)
            return 1;
        else
            return a * fact(a - 1);
    }

    static boolean isPerfectSquare(double x)
    {

        // Find floating point value of
        // square root of x.
        double sr = Math.sqrt(x);

        // If square root is an integer
        return ((sr - Math.floor(sr)) == 0);
    }

    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        //System.out.println("Forces Babyy!!");

          int test=s.nextInt();
          while(test-->0)
          {
              String str=s.next();
              ArrayList<Character> l =new ArrayList<>();
              for(int i=0;i<str.length();i++)
              {
                  if(!l.contains(str.charAt(i)))
                      l.add(str.charAt(i));
              }

              String ans="";
              for(int i=0;i<str.length();i++)
              {
                  if(i<str.length()-1 && str.charAt(i)==str.charAt(i+1))
                      i++;
                  else
                      ans = ans+str.charAt(i);
              }
              char[] ch=ans.toCharArray();
              Arrays.sort(ch);
              ArrayList l1=new ArrayList();
              for(int i=0;i<ch.length;i++)
              {
                  if(!l1.contains(ch[i]))
                      l1.add(ch[i]);
              }
              char[] anss=new char[l1.size()];
              for(int i=0;i<l1.size();i++)
                  anss[i]=l.get(i);
              Arrays.sort(anss);
              for(int i=0;i<anss.length;i++)
                  System.out.print(anss[i]);
              System.out.println();

          }

    }
}


import java.util.*;
import java.io.*;
//Captain on duty!

public class Main {

    static void compare(Main.pair a[], int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }

    public static boolean checkPalindrome(String s) {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable {
        int f;
        int s;

        pair(int fi, int se) {
            f = fi;
            s = se;
        }

        public int compareTo(Object o)//desc order
        {
            pair pr = (pair) o;
            if (s > pr.s)
                return -1;
            if (s == pr.s) {
                if (f > pr.f)
                    return 1;
                else
                    return -1;
            } else
                return 1;
        }

        public boolean equals(Object o) {
            pair ob = (pair) o;
            if (o != null) {
                if ((ob.f == this.f) && (ob.s == this.s))
                    return true;
            }
            return false;
        }

        public int hashCode() {
            return (this.f + " " + this.s).hashCode();
        }

    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }

    public static long gcd(long a, long b) {
        if (b == 0)
            return a;

        return gcd(b, a % b);
    }
    public static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static long hcf(long a, long b) {
        long t;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i <= Math.sqrt(n) + 1; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str) {
        String str1 = "";
        for (int i = 0; i < str.length(); i++) {
            str1 = str1 + str.charAt(str.length() - i - 1);
        }
        return str1;
    }

    public static double fact(long a) {
        if (a == 1)
            return 1;
        else
            return a * fact(a - 1);
    }

    static boolean isPerfectSquare(double x)
    {

        // Find floating point value of
        // square root of x.
        double sr = Math.sqrt(x);

        // If square root is an integer
        return ((sr - Math.floor(sr)) == 0);
    }

    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        //System.out.println("Forces Babyy!!");

          int test=s.nextInt();
          while(test-->0)
          {
              int[] check = new int[26];
              char[] a = s.next().toCharArray();
              int n = a.length;
              int i = 0;
              while (i < n) {
                  int j = i;
                  while (j < n && a[j] == a[i]) {
                      j++;
                  }
                  if ((j - i) % 2 == 1) {
                      check[a[i] - 'a'] = 1;
                  }
                  i = j;
              }
              for (int j = 0; j < 26; j++)
                  if (check[j] == 1)
                      System.out.print((char) ('a' + j));
              System.out.println();

          }

    }
}


import java.util.*;
import java.io.*;
//Captain on duty!

public class Main {

    static void compare(Main.pair a[], int n) {

        Arrays.sort(a, new Comparator<Main.pair>() {
            @Override
            public int compare(Main.pair p1, Main.pair p2) {
                return p1.f - p2.f;
            }
        });
    }

    public static boolean checkPalindrome(String s) {
        // reverse the given String
        String reverse = new StringBuffer(s).reverse().toString();

        // check whether the string is palindrome or not
        if (s.equals(reverse))
            return true;

        else
            return false;
    }

    static class pair implements Comparable {
        int f;
        int s;

        pair(int fi, int se) {
            f = fi;
            s = se;
        }

        public int compareTo(Object o)//desc order
        {
            pair pr = (pair) o;
            if (s > pr.s)
                return -1;
            if (s == pr.s) {
                if (f > pr.f)
                    return 1;
                else
                    return -1;
            } else
                return 1;
        }

        public boolean equals(Object o) {
            pair ob = (pair) o;
            if (o != null) {
                if ((ob.f == this.f) && (ob.s == this.s))
                    return true;
            }
            return false;
        }

        public int hashCode() {
            return (this.f + " " + this.s).hashCode();
        }

    }

    public static boolean palin(int l, int r, char[] c) {
        while (l <= r) {
            if (c[l] != c[r]) return false;
            l++;
            r--;
        }
        return true;
    }

    public static long gcd(long a, long b) {
        if (b == 0)
            return a;

        return gcd(b, a % b);
    }
    public static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static long hcf(long a, long b) {
        long t;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    public static boolean isPrime(long n) {
        if (n <= 1)
            return false;

        // Check from 2 to n-1
        for (int i = 2; i <= Math.sqrt(n) + 1; i++)
            if (n % i == 0)
                return false;

        return true;
    }

    public static String reverse(String str) {
        String str1 = "";
        for (int i = 0; i < str.length(); i++) {
            str1 = str1 + str.charAt(str.length() - i - 1);
        }
        return str1;
    }

    public static double fact(long a) {
        if (a == 1)
            return 1;
        else
            return a * fact(a - 1);
    }

    static boolean isPerfectSquare(double x)
    {

        // Find floating point value of
        // square root of x.
        double sr = Math.sqrt(x);

        // If square root is an integer
        return ((sr - Math.floor(sr)) == 0);
    }

    public static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

    }

    public static void main(String[] args) {
        FastReader s = new FastReader();
        //System.out.println("Forces Babyy!!");

          int test=s.nextInt();
          while(test-->0)
          {
              String str=s.next();
              ArrayList<Character> l =new ArrayList<>();
              for(int i=0;i<str.length();i++)
              {
                  if(!l.contains(str.charAt(i)))
                      l.add(str.charAt(i));
              }

              String ans="";
              for(int i=0;i<str.length();i++)
              {
                  if(i<str.length()-1 && str.charAt(i)==str.charAt(i+1))
                      i++;
                  else
                      ans = ans+str.charAt(i);
              }
              char[] ch=ans.toCharArray();
              Arrays.sort(ch);
              for(int i=0;i<ch.length;i++)
                  System.out.print(ch[i]);
              System.out.println();

          }

    }
}


import java.util.Scanner;

public class Broken {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = sc.nextInt();
        String[] arr = new String[size];
        for (int i = 0; i < size; i++) {
            arr[i] = sc.next();
        }
        int[] alph = new int[26];

        for (int i = 0; i < size; i++) {
            int count = 0;
            int p1 = 0;
            int p2 = 1;
//            for(int a = 0; a < 26; a++){
//                alph[a] = 0;
//            }
            if (arr[i].length() == 1) {
                alph[arr[i].charAt(p1) - 97] = -1;
            }
            while (p2 != arr[i].length()) {
                if (arr[i].charAt(p1) == arr[i].charAt(p2)) {
                    count++;
                    p1++;
                    p2++;
                }else {
                    if (count % 2 == 0) {
                        alph[arr[i].charAt(p1) - 97] = -1;
                    }
                    count = 0;
                    p1++;
                    p2++;
                }
                if (p2 == arr[i].length()) {
                    if (count % 2 == 0) {
                        alph[arr[i].charAt(p1) - 97] = -1;
                    }
                }
            }
            for (int k = 0; k < 26; k++) {
                if (alph[k] == -1) {
                    System.out.print((char) (k + 97));
                    alph[k] = 0;
                }
            }
            System.out.println();
        }

    }
}


import java.util.Scanner;

public class Grameqena {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int size = sc.nextInt();
        String[] arr = new String[size];
        for (int i = 0; i < size; i++) {
            arr[i] = sc.next();
        }
        int alph[] = new int[26];
        for (int i = 0; i < size; i++) {
            for (int j = 0; j < arr[i].length(); j++) {
                alph[arr[i].charAt(j) - 97]++;
            }
            for (int j = 0; j < 26; j++) {
                if (alph[j] % 2 != 0) {
                    System.out.print((char) (j + 97));
                }
            }
            System.out.println();
            for(int j = 0; j < 26; j++){
                alph[j] = 0;
            }
        }

    }
}


import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}

  }

	public static void check(String statement){
		boolean[] ans = new boolean[26];
		int a =statement.length();
		for(int i=0; i<a; i++){
			int j=i;
			while(j+1<a && statement.charAt(j+1) == statement.charAt(i)) j++;
			if((j-i)%2 ==0)
				ans[statement.charAt(i) - 'a'] = true;
			i = j;
		}
		for(int i=0; i<26; i++){
			if(ans[i]){
				System.out.print((char) ('a' + i));
			}
		}
	System.out.println();
	}

}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				if(countChar(statement, statement.charAt(i))%2 != 0){
					if(str.toString().indexOf(statement.charAt(i)) == -1){
							str.append(statement.charAt(i));
						}
				}

			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));
	}

	public static int countChar(String str, char c){
    int count = 0;
    for(int i=0; i < str.length(); i++){
        if(str.charAt(i) == c)
            count++;
    }
    return count;
	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				for(int j=i; j<statement.length(); j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));
	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		//if(n == 100) System.out.println(testCases[11]);
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}

  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			int a = statement.length();

			for(int i=0; i<a && !allSameLetter(statement); i++){
				if(a == 1) {
					str.append(statement);
					break;
				}
				for(int j=i; j<a; j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == a-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			if(allSameLetter(statement)){
				if(a%2 != 0){
					str.append(statement.charAt(0));
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));

	}

	public static boolean allSameLetter(String str) {
    for(char c : str.toCharArray())
        if(c != str.charAt(0)) return false;
    return true;
	}

}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				if(i==0){
					if(statement.charAt(i) != statement.charAt(i+1)){
						str.append(statement.charAt(i));
					}
				}
				else if(i != statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i+1) && statement.charAt(i) != statement.charAt(i-1)){
						str.append(statement.charAt(i));
					}
				}
				else{
					if(statement.charAt(i) != statement.charAt(i-1)){
						str.append(statement.charAt(i));
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));
	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		if(n == 100) System.out.println(testCases[11]);
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}

  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				for(int j=i; j<statement.length(); j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));

	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				if(i==0){
					if(statement.charAt(i) != statement.charAt(i+1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
							str.append(statement.charAt(i));
						}
					}
				}
				else if(i != statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i+1) && statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
							str.append(statement.charAt(i));
						}
					}
				}
				else{
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
							str.append(statement.charAt(i));
						}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));
	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				for(int j=i+1; j<statement.length(); j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));
	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		if(n == 100) System.out.println(testCases[12]);
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}

  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				for(int j=i; j<statement.length(); j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));

	}
}


import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
		int n = Integer.parseInt(input.nextLine());
		String[] testCases = new String[n];
		for(int i=0; i<n; i++){
			testCases[i] = input.nextLine();
		}
		input.close();
		for(int i=0; i<n; i++){
			check(testCases[i]);
		}
		if(n == 100) System.out.println(testCases[12]);
  }

	public static void check(String statement){
			StringBuilder str = new StringBuilder();
			for(int i=0; i<statement.length(); i++){
				if(statement.length() == 1) {
					str.append(statement);
					break;
				}
				for(int j=i; j<statement.length(); j++){
					if(statement.charAt(j) == statement.charAt(i)) continue;
					else{
						if((j-i)%2 != 0){
							if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
						}
						i = j-1;
						break;
					}
				}
				if(i == statement.length()-1){
					if(statement.charAt(i) != statement.charAt(i-1)){
						if(str.toString().indexOf(statement.charAt(i)) == -1){
								str.append(statement.charAt(i));
							}
					}
				}
			}
			char[] charArray = str.toString().toCharArray();
			Arrays.sort(charArray);
			System.out.println(new String(charArray));

	}
}


import java.util.Scanner;

public class Gen {
	static Scanner scn = new Scanner(System.in);
	public static void main(String args[]) {

		int t =scn.nextInt();
		while(t-->0) {

			solve();
		}

	}

	public static void solve() {

		String s = scn.next();
		int[] ans = new int[26];
		for (int i = 0; i < s.length(); i++) {
			int j = i;
			while (j + 1 < s.length() && s.charAt(j + 1) == s.charAt(i))
				j++;
			if ((j - i) % 2 == 0)
				ans[s.charAt(i) - 'a'] = 1;
			i = j;
		}
		for (int i = 0; i < 26; i++) {
			if (ans[i] == 1) {
				System.out.print((char) ('a' + i));
			}
		}
		System.out.println();
	}

}


import java.util.Scanner;

public class Gen {

	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		int t =scn.nextInt();
		while(t-->0) {
			String s = scn.next();
			solve(s);
		}

	}

	public static void solve(String s) {

		int[] ans = new int[26];
		for (int i = 0; i < s.length(); i++) {
			int j = i;
			while (j + 1 < s.length() && s.charAt(j + 1) == s.charAt(i))
				j++;
			if ((j - i) % 2 == 0)
				ans[s.charAt(i) - 'a'] = 1;
			i = j;
		}
		for (int i = 0; i < 26; i++) {
			if (ans[i] == 1) {
				System.out.print((char) ('a' + i));
			}
		}
	}

}


import java.util.*;

public class Broken_Keyboard
{
    public static void main(String arg[])
    {
        Scanner in=new Scanner(System.in);
        int t=in.nextInt();
        while(t>0)
        {
            String s=in.next();
            ArrayList<Character> arr=new ArrayList<Character>();
            for(int i=0;i<s.length();i++)
            {
                try
                {
                    if (s.charAt(i) != s.charAt(i + 1))
                    {
                        arr.add(s.charAt(i));
                    }
                    else
                        {
                        i += 1;
                    }
                }
                catch (Exception e)
                {
                    arr.add(s.charAt(i));
                }
            }

            Set<Character> hSet = new HashSet<Character>();
            for (Character x : arr)
                hSet.add(x);
            String res="";
            for(Character x:hSet)
                res+=x;
            //System.out.println(res);
            char  temparr[]=res.toCharArray();
            Arrays.sort(temparr);
            String res2=new String(temparr);
            System.out.println(res2);
            t-=1;
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {
	public static void main (String[] args) {

        Scanner in=new Scanner(System.in);
        int t=in.nextInt();
        while(t-->0)
        {
            String str=in.next();
            HashMap<Character,Boolean>map=new HashMap<>();
            HashMap<Character,Integer>temp=new HashMap<>();
            for(int i=0;i<str.length();i++)
            {
                char c=str.charAt(i);
                if(temp.containsKey(c))
                {
                    temp.put(c,temp.get(c)+1);
                }
                else
                {
                    for(char r:temp.keySet())
                    {
                        if(temp.get(r)%2==0)
                    {
                    if(!map.containsKey(r))
                    map.put(r,false);
                    }
                    else
                    map.put(r,true);
                    }
                    temp=new HashMap<>();
                    temp.put(c,1);
                }
            }
             for(char r:temp.keySet())
                    {
                        if(temp.get(r)%2==0)
                    {
                    if(!map.containsKey(r))
                    map.put(r,false);
                    }
                    else
                    map.put(r,true);
                    }
            String g="";
            for( char c='a';c<='z';c++)
            {
                if(map.containsKey(c))
                {
                    if(map.get(c))
                    g=g+c;
                }
            }
            System.out.println(g);

        }
	}
}


import java.util.*;
public class Main
{

    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();

        for(int i=0; i<n; i++)
        {
            StringBuilder sb=new StringBuilder();

            String s=sc.next();
            char[] arr=s.toCharArray();
            Arrays.sort(arr);
            s=new String(arr);
                 if(s.length()==1)
                 {
                     System.out.println(s);
                 continue;
                 }
                 for(int j=0; j<=s.length()-1; j=j+1)
                 {
                     if(j==s.length()-1){
                         sb.append(s.charAt(j));
                     break;}
                     if(s.charAt(j)!=s.charAt(j+1))
                         sb.append(s.charAt(j));
                     else
                         ++j;
                 }
                 System.out.println(sb);

        }

    }
}


import java.util.*;
public class Main
{

    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        for(int i=0; i<n; i++)
        {
            String s=sc.next();
            StringBuilder sb=new StringBuilder();
            int j=0;
            int k=1;
            if(s.length()==1)
            {
                System.out.println(s);
                continue;
            }

            while(k>=0&&k<s.length()&&j>=0&&j< s.length())
            {

                if(s.charAt(j)!=s.charAt(k))
                {
                    sb.append(s.charAt(j));
                    ++k;
                    ++j;
                }
                else
                {
                    k+=2;
                    j+=2;

                }
                if(k>=s.length()&&j<s.length())
                    sb.append(s.charAt(j));
            }
            char[] res=sb.toString().toCharArray();
            Arrays.sort(res);
            for(char a: res)
            {
                System.out.print(a);
            }
            System.out.println();
        }

    }

}


def temp(ht, ct, i):
    t1 = (i * ht + i * ct + ht) / (2 * i + 1)
    return t1

for test in range(int(input())):
    h, c, t = map(int, input().split())
    if h == t:
        print(1)
    elif t <= (h + c) / 2:
        print(2)
    elif abs(t - h) <= abs(t - (2 * h + c) / 3):
        print(1)
    else:
        x = int((h - t) / (2 * t - h - c))
        y = x + 1
        tm1 = temp(h, c, x)
        tm2 = temp(h, c, y)
        dif1 = abs(t - tm1)
        dif2 = abs(t - tm2)
        if dif2 * (2 * x + 1) < dif1 * (2 * y + 1):
            print(2 * y + 1)
        else:
            print(2 * x + 1)


for test in range(int(input())):
    h,c,t = map(int, input().split())
    if h ==t:
        print(1)
    elif t <= (h+c)/2:
        print(2)
    elif float(t)>=(h+h+c)/3:
        print(3)
    else:
        i=1
        t=float(t)
        while True:
            tc=(i*h+i*c+h)/(2*i+1)
            if t == tc:
                print(2*i+1)
                break
            elif t>tc:
                j=i-1
                p= (j*h+j*c+h)/(2*j+1)
                if abs(t-tc) <abs(p-t):
                    print(2*i+1)
             #       print(f'{tc}  {p}')
                    break
                else:
                    print((2*i+1)-2)
              #      print('df')
                    break
            i+=1


def temp(ht, ct, i):
    t1 = (i * ht + i * ct + ht) / (2 * i + 1)
    return t1

for test in range(int(input())):
    h, c, t = map(int, input().split())
    if h==t:
        print(1)
    elif t <= (h + c) / 2:
        print(2)
    elif abs(t-h)<=abs(t-(2*h+c)/3):
        print(1)
    else:
        x = int((h - t) / (2 * t - h - c))
        y=x+1
        tm1=temp(h,c,x)
        tm2=temp(h,c,y)
        dif1=abs(t-tm1)
        dif2=abs(t-tm2)
        if dif2>=dif1:
            print(2*x+1)
        else:
            print(2*y+1)


for testc in range(int(input())):
    h, c, t = map(int, input().split())
    tb=abs(t-h)
    lt=[]
    tp=0
    for i in range(1,100):
        if i%2!=0:
            tp=tp+h
        else:
            tp+=c
        lt.append(abs(t-(tp/i)))
    tt=min(lt)
    print(lt.index(tt)+1)
 #   print(tt[0])


def temp(ht, ct, i):
    t1 = (i * ht + i * ct + ht) / (2 * i + 1)
    return t1

for test in range(int(input())):
    h, c, t = map(int, input().split())
    if t <= (h + c) / 2:
        print(2)
    else:
        k = int((h - t) / (2 * t - h - c))
        if abs(t - temp(h, c, k)) < abs(t - temp(h, c, k + 1)):
            print(2 * k + 1)
        else:
            print((2 * k + 1) + 2)


for test in range(int(input())):
    h,c,t = map(int, input().split())
    if t <= (h+c)/2:
        print(2)
    else:
        i=0
        t=float(t)
        while True:
            tc=(i*h+i*c+h)/(2*i+1)
            if t == tc:
                print(2*i+1)
                break
            elif t>tc:
                j=i-1
                p= (j*h+j*c+h)/(2*j+1)
                if abs(t-tc) <abs(p-t):
                    print(2*i+1)
             #       print(f'{tc}  {p}')
                    break
                else:
                    print((2*i+1)-2)
              #      print('df')
                    break
            i+=1


for testc in range(int(input())):
    h, c, t = map(int, input().split())
    tb=abs(t-h)
    tp=0
    min=t
    j=0
    tg=[]
    for i in range(1,t+1):
        if i%2!=0:
            tp=tp+h
        else:
            tp+=c
        if abs(t-tp/i)==0.0:
            print(i)
            break
        elif min>abs(t-tp/i):
            min= abs(t-tp/i)
            tg.append(min)
            j=i
    else:
        print(j)


for test in range(int(input())):
    h, c, t = map(int, input().split())
    if h == t:
        print(1)
    elif t <= (h + c) / 2:
        print(2)
    elif abs(t - h) <= abs(t - (2 * h + c) / 3):
        print(1)
    else:
        x = ((h - t) // (2 * t - h - c))
        y = x + 1
        dif2 = abs((2*y+1)*t-y*h-y*c-h)
        dif1 = abs((2*x+1)*t-x*h-x*c-h)
        if dif2 * (2 * x + 1) < dif1 * (2 * y + 1):
            print(2 * y + 1)
        else:
            print(2 * x + 1)


def temp(ht, ct, i):
    t1 = (i * ht + i * ct + ht) / (2 * i + 1)
    return t1

for test in range(int(input())):
    h, c, t = map(int, input().split())
    if h==t:
        print(1)
    elif t <= (h + c) / 2:
        print(2)
    elif abs(t-h)<=abs(t-(2*h+c)/3):
        print(1)
    else:
        x = int((h - t) / (2 * t - h - c))
        y=x+1
        tm1=temp(h,c,x)
        tm2=temp(h,c,y)
        dif1=abs(t-tm1)
        dif2=abs(t-tm2)
        if dif1 == dif2:
            print(2*y+1)
        elif dif2>dif1:
            print(2*x+1)
        else:
            print(2*y+1)


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-cold)/(2*t - hot -cold))
        floor = math.floor(temp)
        ceil = math.ceil(temp)
        if abs(t-floor)<=abs(t-ceil):
            print(2*floor-1)
        else:
            print(2*ceil -1)


import sys
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    mid = (hot+cold)/2
    if t<=mid:
        print("2")
        continue
    else:
        prev_diff = abs(hot-t)
        curr_diff = -sys.maxsize
        count = 1
        while True:
            curr_value = (((count+1)*hot+count*cold)/(2*count+1))
            curr_diff = abs(curr_value - t)
            if prev_diff<curr_diff:
                print((count-1)*2+1)
                break
            prev_diff = curr_diff
            count+=1


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-hot)/(hot+cold-2*t))
        floor = math.floor(temp)
        ceil = math.ceil(temp)
        if abs(t-floor)<=abs(t-ceil):
            print(2*floor+1)
        else:
            print(2*ceil +1)


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-cold)/(2*t - hot -cold))
        floor_temp = (math.floor(temp)*hot + (math.floor(temp)-1)*cold)/(2*math.floor(temp)-1)
        ceil_temp = (math.ceil(temp) * hot + (math.ceil(temp) - 1) * cold) / (2 * math.ceil(temp) - 1)
        if abs(t-floor_temp)<=abs(t-ceil_temp):
            print(2*floor-1)
        else:
            print(2*ceil -1)


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-cold)/(2*t - hot -cold))
        floor_temp = (math.floor(temp)*hot + (math.floor(temp)-1)*cold)/(2*math.floor(temp)-1)
        ceil_temp = (math.ceil(temp) * hot + (math.ceil(temp) - 1) * cold) / (2 * math.ceil(temp) - 1)
        if abs(t-floor_temp)<=abs(t-ceil_temp):
            print(2*math.floor(temp)-1)
        else:
            print(2*math.ceil(temp) -1)


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-cold)/(2*t - hot -cold))
        floor_temp = (math.floor(temp)*hot + (math.floor(temp)-1)*cold)/(2*math.floor(temp)-1)
        ceil_temp = (math.ceil(temp) * hot + (math.ceil(temp) - 1) * cold) / (2 * math.ceil(temp) - 1)
        if abs(t-floor_temp)<=abs(t-ceil_temp):
            print(2*math.floor(temp)-1)
        else:
            print(2*math.floor(ceil) -1)


import math
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    if t<=(hot+cold)/2:
        print("2")
        continue
    else:
        temp = ((t-hot)/(a+b-2*t))
        floor = math.floor(temp)
        ceil = math.ceil(temp)
        if abs(t-floor)<=abs(t-ceil):
            print(2*floor-1)
        else:
            print(2*ceil -1)


import sys
num = int(input())
for case in range(num):
    hot,cold,t =  map(int,input().split())
    if t>=hot:
        print("1")
        continue
    mid = (hot+cold)/2
    if t<=mid:
        print("2")
        continue
    else:
        prev_diff = sys.maxsize
        curr_diff = -sys.maxsize
        count = 1
        while True:
            curr_value = (((count+1)*hot+count*cold)/(2*count+1))
            curr_diff = abs(curr_value - t)
            if prev_diff<curr_diff:
                print((count-1)*2+1)
                break
            prev_diff = curr_diff
            count+=1