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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        String str2 = sc.nextLine();
        System.out.println(str2);

        for(int i = 0; i < a; i++){
            //System.out.println(i);
            String str = sc.nextLine();
            char[] mass = new char[str.length()];
            for(int v = 0; v<str.length(); v++) {
                //System.out.println(v);
                mass[v] = str.charAt(v);
            }
            ArrayList<Character> results = new ArrayList<>();
            for(int m = 0;m<str.length(); m++){
                if(m==str.length()-1) {
                    //System.out.println(mass[m]);
                    results.add(mass[m]);
                }
                else if(mass[m]==mass[m+1]){
                    m++;
                }
                else {
                    //System.out.println(mass[m]);
                    results.add(mass[m]);
                }
            }
            Collections.sort(results);
            for(int k = 0 ; k<results.size(); k++){
                System.out.print(results.get(k));
            }
            System.out.println();
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.StringTokenizer;

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);

        TaskA solver = new TaskA();
        int q = in.nextInt();
        for (int i = 0; i < q; ++i) {
            solver.solve(in, out);
        }

        out.close();
    }

    static class TaskA {
        void solve(InputReader in, PrintWriter out) {
            String s = in.next();
            boolean[] f = new boolean[26];
            int n = s.length();
            for (int i = 0; i < n; ++i) {
                int j = i;
                while (j + 1 < n && s.charAt(j + 1) == s.charAt(i))
                    j++;
                if ((j - i) % 2 == 0)
                    f[s.charAt(i) - 'a'] = true;
                i = j;
            }
            for (int i = 0; i < 26; ++i) {
                if (f[i]) {
                    char c = (char) (i+'a');
                    out.print(c);
                }
            }
            out.println();
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.StringTokenizer;

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);

        TaskA solver = new TaskA();
        int q = in.nextInt();
        for (int i = 0; i < q; ++i) {
            solver.solve(in, out);
        }

        out.close();
    }

    static class TaskA {
        void solve(InputReader in, PrintWriter out) {
            String s = in.next();
            int[] f = new int[26];
            int n = s.length();
            if (n==1) {
                out.println(s);
                return;
            }
            for (int i = 0; i < n-1; ++i) {
                if (s.charAt(i) != s.charAt(i+1))
                    f[s.charAt(i)-'a'] = 1;
                else
                    i++;
            }
            for (int i = n-1; i > 0; --i) {
                if (s.charAt(i) != s.charAt(i-1))
                    f[s.charAt(i)-'a'] = 1;
                else
                    --i;
            }
            for (int i = 0; i < 26; ++i) {
                if (f[i] == 1) {
                    char c = (char) (i+'a');
                    out.print(c);
                }
            }
            out.println();
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.StringTokenizer;

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);

        TaskA solver = new TaskA();
        int q = in.nextInt();
        for (int i = 0; i < q; ++i) {
            solver.solve(in, out);
        }

        out.close();
    }

    static class TaskA {
        void solve(InputReader in, PrintWriter out) {
            String s = in.next();
            int[] f = new int[26];
            int n = s.length();
            for (int i = 0; i < n; ++i) {
                f[s.charAt(i)-'a']++;
            }
            for (int i = 0; i < 26; ++i) {
                if (f[i]%2 == 1) {
                    char c = (char) (i+'a');
                    out.print(c);
                }
            }
            out.println();
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;
        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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


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

public class keyboard {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        String[] res = new String[t];
        for (int i = 0; i < t; i++) {
            String s = in.next();
            String r="";
            char[] arr = s.toCharArray();

            for (int j = 0; j < arr.length-1; j++) {
               if(arr[j]==arr[j+1]){
                   arr[j]='1';
                   arr[j+1]='1';
               }
            }
            r=new String(arr).replaceAll("1","");
            String[] r1 = r.split("");
            TreeSet<String> sor = new TreeSet<>(Arrays.asList(r1));
            for(String q:sor){
                if(q!=null)
                res[i]+=q;
            }
        }
        for(String s:res){
            String s1 = s.replaceAll("null","");
            System.out.println(s1+" ");
        }
    }
}


import java.util.Scanner;

public class keyboard {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        String[] res = new String[t];
        for (int i = 0; i < t; i++) {
            String s = in.next();
            char[] arr = s.toCharArray();
            for (int j = 0; j < arr.length-1; j++) {
               if(arr[j]==arr[j+1]){
                   arr[j]='1';
                   arr[j+1]='1';
               }
            }
            res[i]=new String(arr);
        }
        for(String s:res){
            String e = s.replaceAll("1","");
            System.out.println(e+" ");
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Set;

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            StringBuilder sb = new StringBuilder();
            Set<Character> set = new HashSet<>();
            int j = 0;
            for (int i = 1; i < str.length(); i++) {
                if (str.charAt(i) != str.charAt(i - 1)) {
                    if ((i - j) % 2 == 1 && !set.contains(str.charAt(i - 1))) {
                        set.add(str.charAt(i - 1));
                        sb.append(str.charAt(i - 1));
                    }
                    j = i;
                }
            }
            int len = str.length();
            if ((len - j) % 2 == 1 && !set.contains(str.charAt(len - 1))) sb.append(str.charAt(len - 1));
            char[] carr = sb.toString().toCharArray();
            Arrays.sort(carr);
            out.println(new String(carr));
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

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

    static class TaskA {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String str = in.next();
            StringBuilder sb = new StringBuilder();
            int i;
            for (i = 0; i < str.length() - 1; i++) {
                if (str.charAt(i) != str.charAt(i + 1)) {
                    sb.append(str.charAt(i));
                } else {
                    i++;
                }
            }
            if (i < str.length()) sb.append(str.charAt(i));
            char[] carr = sb.toString().toCharArray();
            Arrays.sort(carr);
            out.println(new String(carr));
        }

    }
}


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

public class A {

	public static void main(String[] agrs) {
		FastScanner sc = new FastScanner();
		int yo = sc.nextInt();
		while(yo-->0) {
			char[] s = sc.next().toCharArray();
			Set<Character> set = new HashSet<>();
			for(int i = 0; i < s.length; i++) {
				if(i + 1 < s.length && s[i] != s[i+1]) {
					set.add(s[i]);
				}
				else {
					if(set.contains(s[i])) {
						set.remove(s[i]);
					}
					i++;
				}
			}
			if(s.length-2 >= 0 && s[s.length-1] != s[s.length-2]) {
				set.add(s[s.length-1]);
			}
			if(s.length == 1) {
				set.add(s[0]);
			}
			String res = "";
			for(Character c : set) {
				res += c;
			}
			System.out.println(res);
		}

	}

	static int gcd(int a, int b) {
		return a%b == 0 ? b : gcd(b,a%b);
	}

	static int mod = 1000000007;

	static long pow(int a, int b) {
		if(b == 0) {
			return 1;
		}
		if(b == 1) {
			return a;
		}
		if(b%2 == 0) {
			long ans = pow(a,b/2);
			return ans*ans;
		}
		else {
			long ans = pow(a,(b-1)/2);
			return a * ans * ans;
		}

	}

	static boolean[] sieve(int n) {

		boolean isPrime[] = new boolean[n+1];
		for(int i = 2; i <= n; i++) {
			if(isPrime[i]) continue;
			for(int j = 2*i; j <= n; j+=i) {
				isPrime[j] = true;
			}
		}
		return isPrime;
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


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

public class A {

	public static void main(String[] agrs) {
		FastScanner sc = new FastScanner();
		int yo = sc.nextInt();
		while(yo-->0) {
			char[] s = sc.next().toCharArray();
			Set<Character> set = new HashSet<>();
			int i = 0;
			while(i < s.length){
				if(i + 1 < s.length && s[i] == s[i+1]) {
					i += 2;
				}
				else {
					set.add(s[i]);
					i++;
				}
			}

			List<Character> charSort = new ArrayList<>(set);
			Collections.sort(charSort);
			String res = "";
			for(char e : charSort) {
				res += e;
			}
			System.out.println(res);
		}

	}

	static int gcd(int a, int b) {
		return a%b == 0 ? b : gcd(b,a%b);
	}

	static int mod = 1000000007;

	static long pow(int a, int b) {
		if(b == 0) {
			return 1;
		}
		if(b == 1) {
			return a;
		}
		if(b%2 == 0) {
			long ans = pow(a,b/2);
			return ans*ans;
		}
		else {
			long ans = pow(a,(b-1)/2);
			return a * ans * ans;
		}

	}

	static boolean[] sieve(int n) {

		boolean isPrime[] = new boolean[n+1];
		for(int i = 2; i <= n; i++) {
			if(isPrime[i]) continue;
			for(int j = 2*i; j <= n; j+=i) {
				isPrime[j] = true;
			}
		}
		return isPrime;
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


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

public class A {

	public static void main(String[] agrs) {
		FastScanner sc = new FastScanner();
		int yo = sc.nextInt();
		while(yo-->0) {
			char[] s = sc.next().toCharArray();
			Set<Character> set = new HashSet<>();
			for(int i = 0; i < s.length; i++) {
				if(i + 1 < s.length && s[i] != s[i+1]) {
					set.add(s[i]);
				}
				else {
					i++;
				}
			}
			if(s.length-2 >= 0 && s[s.length-1] != s[s.length-2]) {
				set.add(s[s.length-1]);
			}
			if(s.length == 1) {
				set.add(s[0]);
			}
			String res = "";
			for(Character c : set) {
				res += c;
			}
			System.out.println(res);
		}

	}

	static int gcd(int a, int b) {
		return a%b == 0 ? b : gcd(b,a%b);
	}

	static int mod = 1000000007;

	static long pow(int a, int b) {
		if(b == 0) {
			return 1;
		}
		if(b == 1) {
			return a;
		}
		if(b%2 == 0) {
			long ans = pow(a,b/2);
			return ans*ans;
		}
		else {
			long ans = pow(a,(b-1)/2);
			return a * ans * ans;
		}

	}

	static boolean[] sieve(int n) {

		boolean isPrime[] = new boolean[n+1];
		for(int i = 2; i <= n; i++) {
			if(isPrime[i]) continue;
			for(int j = 2*i; j <= n; j+=i) {
				isPrime[j] = true;
			}
		}
		return isPrime;
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


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

public class A {

	public static void main(String[] agrs) {
		FastScanner sc = new FastScanner();
		int yo = sc.nextInt();
		while(yo-->0) {
			char[] s = sc.next().toCharArray();
			Set<Character> set = new HashSet<>();
			int i = 0;
			while(i < s.length){
				if(i + 1 < s.length && s[i] == s[i+1]) {
					i += 2;
				}
				else {
					set.add(s[i]);
					i++;
				}
			}

			String res = "";
			for(Character c : set) {
				res += c;
			}
			System.out.println(res);
		}

	}

	static int gcd(int a, int b) {
		return a%b == 0 ? b : gcd(b,a%b);
	}

	static int mod = 1000000007;

	static long pow(int a, int b) {
		if(b == 0) {
			return 1;
		}
		if(b == 1) {
			return a;
		}
		if(b%2 == 0) {
			long ans = pow(a,b/2);
			return ans*ans;
		}
		else {
			long ans = pow(a,(b-1)/2);
			return a * ans * ans;
		}

	}

	static boolean[] sieve(int n) {

		boolean isPrime[] = new boolean[n+1];
		for(int i = 2; i <= n; i++) {
			if(isPrime[i]) continue;
			for(int j = 2*i; j <= n; j+=i) {
				isPrime[j] = true;
			}
		}
		return isPrime;
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

}


import java.util.*;
public class BrokenKeyboard {

	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();
			int a[]=new int[256];
			for(char c:s.toCharArray()) {
				int index=(int)c;
				a[index]++;
			}
			String res="";
			for(int i=97;i<123;i++) {
				if(a[i]!=0 && a[i]!=2) res+=(char)i;
			}
			System.out.println(res);
		}

	}

}


import java.util.*;
public class BrokenKeyboard {

	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 ans[]=new boolean[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'] = true;
				i = j;
			}String res="";
			for(int i=0;i<26;i++) {
				if(ans[i])res+=(char)('a'+i);
			}
			System.out.println(res);
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            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;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
         int T = sc.nextInt();while (T--!=0)
        {
            solve();
        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
   static  FastReader sc = new FastReader();
  //  static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
       boolean [] is = new boolean[200];
       String s =sc.next();
       int low=0,hi=s.length();
           int [] freq   = new int[200];
        if(hi==1){
            System.out.println(s);
            return;
        }
        if(s.charAt(hi-1)!=s.charAt(hi-2)){
            is[s.charAt(hi-1)]=true;
        }
        if(s.charAt(low)!=s.charAt(low+1)){
            is[s.charAt(low)]=true;
        }
       while(low<hi-1){
          freq[s.charAt(low)]++;
          if(s.charAt(low)!=s.charAt(low+1)){
              if(freq[s.charAt(low)]%2!=0){
                  is[s.charAt(low)]=true;
              }
          }
          low++;

       }
        for (int i = 0; i < is.length; i++) {
            if(is[i]) {
                System.out.print((char)(i));
            }
        }
        System.out.println();
///////////////////////////////////////////////////////////////////////
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            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;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
         int T = sc.nextInt();while (T--!=0)
        {
            solve();
        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
   static  FastReader sc = new FastReader();
  //  static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
       boolean [] is = new boolean[200];
       String s =sc.next();
       int low=0,hi=s.length();
           int [] freq   = new int[200];
        if(hi==1){
            System.out.println(s);
            return;
        }
       while(low<hi-1){
          freq[s.charAt(low)]++;
          if(s.charAt(low)!=s.charAt(low+1)){
              if(freq[s.charAt(low)]%2!=0){
                  is[s.charAt(low)]=true;
              }
          }
          low++;

       }
        if(++freq[s.charAt(hi-1)]%2!=0) is[s.charAt(hi-1)] =true;

        for (int i = 0; i < is.length; i++) {
            if(is[i]) {
                System.out.print((char)(i));
            }
        }
        System.out.println();
///////////////////////////////////////////////////////////////////////
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            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;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
         int T = sc.nextInt();while (T--!=0)
        {
            solve();
        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
   static  FastReader sc = new FastReader();
  //  static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
       boolean [] is = new boolean[200];
       String s =sc.next();
       int low=0,hi=s.length();
           int [] freq   = new int[200];
        if(hi==1){
            System.out.println(s);
            return;
        }
        if(s.charAt(hi-1)!=s.charAt(hi-2)){
            is[s.charAt(hi-1)]=true;
        }
       while(low<hi-1){
          freq[s.charAt(low)]++;
          if(s.charAt(low)!=s.charAt(low+1)){
              if(freq[s.charAt(low)]%2!=0){
                  is[s.charAt(low)]=true;
              }
          }
          low++;

       }
        for (int i = 0; i < is.length; i++) {
            if(is[i]) {
                System.out.print((char)(i));
            }
        }
        System.out.println();
///////////////////////////////////////////////////////////////////////
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            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;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
         int T = sc.nextInt();while (T--!=0)
        {
            solve();
        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
   static  FastReader sc = new FastReader();
  //  static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
       boolean [] is = new boolean[200];
       String s =sc.next();
       int low=0,hi=s.length();
           int [] freq   = new int[200];
        if(hi==1){
            System.out.println(s);
            return;
        }
        if(s.charAt(hi-1)!=s.charAt(hi-2)){
            is[s.charAt(hi-1)]=true;
        }
        if(s.charAt(low)!=s.charAt(low+1)){
            is[s.charAt(low)]=true;
        }
       while(low<hi-1){
          freq[s.charAt(low)]++;
          if(s.charAt(low)!=s.charAt(low+1)){
              if(freq[s.charAt(low)]%2!=0){
                  is[s.charAt(low)]=true;
              }
          }
          low++;

       }
        if(++freq[s.charAt(hi-1)]%2!=0) is[s.charAt(hi-1)] =true;

        for (int i = 0; i < is.length; i++) {
            if(is[i]) {
                System.out.print((char)(i));
            }
        }
        System.out.println();
///////////////////////////////////////////////////////////////////////
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
public class CP {
    static long startTime;
    static long endTime;
    static Boolean [] prime ;

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            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;
        }
    }
    public static int lowerBound
            (Integer[] array, int length, int value) {
        int l = 0;
        int r = length;
        while (l < r) {
            int mid = (l + r) / 2;
            if (value < array[mid]) {
                r = mid;
            } else {
                l = mid + 1;
            }
        }
        return l;
    }
    public static long gcd(long a, long b){
        if (b == 0)
            return a;
        else return gcd(b, a % b);
    }
    public  static  long countDivs(long n ){
        int cn=0;
        long sqr = (long)Math.sqrt(n);
        for (long i = 1; i<=sqr ; ++i) {
            if(n%i==0){
                ++cn;
            }
        }
        cn*=2;
        if(sqr*sqr==n) cn--;
        return cn;

    }
    static void prime(int  x) {
        //sieve algorithm. nlog(log(n)).
        prime=new Boolean[ (x+1)];
        Arrays.fill(prime,true);
        prime[0] = prime[1] = false;
        for (int  i = 2; i * i <= x ; i++)
            if (prime[i])
                for (int  j = i * i; j <= x; j += i)
                    prime[j] = false;
    }
    static int[] sum;
    static void cumulitiveSum( int [] arr){
        // make the arrays one indexed.
        sum = new int[arr.length];
        sum[0]=arr[0];
        for (int i = 1; i <arr.length; i++) {
            sum[i]=arr[i]+sum[i-1];
        }
    }
    static boolean isEven(long x ){
        return x % 2 == 0;
    }
    static boolean isPrime(long x ){
        boolean flag = true;
        int sqr = (int)Math.sqrt(x);
        if(x<2) return false;
        for (int i = 2; i <=sqr; i++) {
            if(x%i==0){
                flag=false;
                break;
            }
        }
        return flag;
    }
    static long factorial( long x) {
        long total = 1;
        for (int i = 2; i <= x; i++)
            total *= i;
        return total;
    }
    static long pow(long x, long n) {
        if (n == 0) {
            return 1;
        }

        long pow = pow(x, n / 2L);
        if ((n & 1) == 1) {
            return x * pow * pow;
        }

        return pow * pow;
    }

    public static void main(String [] args) {
        startTime = System.currentTimeMillis();
         int T = sc.nextInt();while (T--!=0)
        {
            solve();
        }
        endTime = System.currentTimeMillis();
        long duration= endTime-startTime;
        //System.out.println(duration);
    }
   static  FastReader sc = new FastReader();
  //  static Scanner sc = new Scanner(System.in);
    public static void solve() {
//////////////////////////////////////////////////////////////////////
       boolean [] is = new boolean[200];
       String s =sc.next();
       int low=1,hi=s.length();
       if(hi==1){
           System.out.println(s);
           return;
       }
       if(hi>=2) {
           if (s.charAt(low - 1) != s.charAt(low)) {
               is[s.charAt(low - 1)] = true;
           }
           if (s.charAt(hi - 1) != s.charAt(hi - 2)) {
               is[s.charAt(hi - 1)] = true;
           }
       }
       if(hi>=3)
       while(low<hi-1){
           if(s.charAt(low)!=s.charAt(low+1) && s.charAt(low)!=s.charAt(low-1)){
               is[s.charAt(low)]=true;
           }
           low++;
       }
        for (int i = 0; i < is.length; i++) {
            if(is[i]) {
                System.out.print((char)(i));
            }
        }
        System.out.println();
///////////////////////////////////////////////////////////////////////
    }

}


import java.io.*;
import java.util.*;
public class file
{
   static void print(String str) {
        int letters[] = new int[26];
        for (char x : str.toCharArray()) {

            letters[x - 'a']++;
        }
        for (int i = 0; i < 26; i++) {
            for (int j = 0; j < letters[i]; j++) {
                System.out.print((char) (i + 'a'));
            }
        }
    }
   public static void main(String args[])throws IOException
   {
      BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
      int t = Integer.parseInt(reader.readLine());
      while(t>0)
      {
         String s = reader.readLine();
      String ans = "";
      int i=0;
      while(i+1<=s.length() && s.length()!=1 && i!=s.length()-1)
      {
        char ch = s.charAt(i);
        if(s.charAt(i+1)!=ch)
        {
          ans+=ch;
          i++;
        }
        else
        {
          i+=2;
        }
      }
      if(i==s.length()-1)
      {
        ans+=s.charAt(s.length()-1);
      }
      if(s.length()==1)
      {
        ans=s;
      }
      print(ans);
      System.out.println("");
         t--;
      }

    }
}


import java.io.*;
import java.util.*;
public class file
{
   public static void main(String args[])throws IOException
   {
      BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
      int t = Integer.parseInt(reader.readLine());
      while(t>0)
      {
         String s = reader.readLine();
      TreeSet<Character> ans = new TreeSet<Character>();
      int i=0;
      while(i+1<=s.length() && s.length()!=1 && i!=s.length()-1)
      {
        char ch = s.charAt(i);
        if(s.charAt(i+1)!=ch)
        {
          ans.add(ch);
          i++;
        }
        else
        {
          i+=2;
        }
      }
      if(i==s.length()-1)
      {
        ans.add(s.charAt(s.length()-1));
      }
      if(s.length()==1)
      {
        System.out.print(s);
      }
      else
      {
        ans.forEach(j -> System.out.print(j));
      }
      System.out.println("");
         t--;
      }

    }
}


import java.util.*;
import java.io.*;
public class Main{

	 public static void main (String args[]){
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int t = sc.nextInt();
        while(t-->0) {
        	char[] arr = sc.next().toCharArray();
        	HashSet<Character> hs = new HashSet<>();
        	for(int i=0; i<arr.length; i++) {
        		if(i==arr.length-1 || arr[i+1]!=arr[i])
        			hs.add(arr[i]);
        		else i++;
        	}
        	for(char i='a'; i<='z'; i++) {
        		if(hs.contains(i))
        			out.print(i);
        	}
        	out.println();
        	out.flush();
        }

    }
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import java.text.DecimalFormat;
import static java.lang.Math.*;

public class Cf182 implements Runnable
{
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

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

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(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;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}

	public static long gcd(long a, long b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
	//  array sorting by colm
public static void sortbyColumn(int arr[][], int col)
    {

        Arrays.sort(arr, new Comparator<int[]>() {

          @Override
          public int compare(final int[] entry1,
                             final int[] entry2) {

            if (entry1[col] > entry2[col])
                return 1;
            else
                return -1;
          }
        });
    }

	// gcd

	public static long findGCD(long arr[], int n)
	{
		long result = arr[0];
		for (int i = 1; i < n; i++)
			result = gcd(arr[i], result);
		return result;
	}
	// fibonaci
	static int fib(int n)
    {
        int a = 0, b = 1, c;
        if (n == 0)
            return a;
        for (int i = 2; i <= n; i++)
        {
            c = a + b;
            a = b;
            b = c;
        }
        return b;
    }

// sort a string
    public static String sortString(String inputString)
    {

        char tempArray[] = inputString.toCharArray();

        Arrays.sort(tempArray);

        return new String(tempArray);
    }
    // pair function

    // list.add(new Pair<>(sc.nextInt(), i + 1));
    //     Collections.sort(list, (a, b) -> Integer.compare(b.first, a.first));
    private static class Pair<F, S> {

        private F first;

        private S second;

        public Pair() {}

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }
    }
    static long power(long x, long y, long p)
    {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
	public void run()
	{
		InputReader sc = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		int t = sc.nextInt();
		while(t--!=0)
		{
		    String s = sc.next();
		    HashMap<Character,Integer> map = new HashMap<Character,Integer>();
		    int n = s.length();
		    String ans = "";
		    for(int i=0;i<n;i++)
		    {
		        if(i+1<n && s.charAt(i)==s.charAt(i+1))
		            i++;
		        else
		        {
		            if(!map.containsKey(s.charAt(i))
		            {
		                ans += Character.toString(s.charAt(i));
		                map.put(s.charAt(i),0);
		            }
		        }
		    }
		    System.out.println(sortString(ans));
		}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import java.text.DecimalFormat;
import static java.lang.Math.*;

public class Cf182 implements Runnable
{
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

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

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(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;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}

	public static long gcd(long a, long b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}
	//  array sorting by colm
public static void sortbyColumn(int arr[][], int col)
    {

        Arrays.sort(arr, new Comparator<int[]>() {

          @Override
          public int compare(final int[] entry1,
                             final int[] entry2) {

            if (entry1[col] > entry2[col])
                return 1;
            else
                return -1;
          }
        });
    }

	// gcd

	public static long findGCD(long arr[], int n)
	{
		long result = arr[0];
		for (int i = 1; i < n; i++)
			result = gcd(arr[i], result);
		return result;
	}
	// fibonaci
	static int fib(int n)
    {
        int a = 0, b = 1, c;
        if (n == 0)
            return a;
        for (int i = 2; i <= n; i++)
        {
            c = a + b;
            a = b;
            b = c;
        }
        return b;
    }

// sort a string
    public static String sortString(String inputString)
    {

        char tempArray[] = inputString.toCharArray();

        Arrays.sort(tempArray);

        return new String(tempArray);
    }
    // pair function

    // list.add(new Pair<>(sc.nextInt(), i + 1));
    //     Collections.sort(list, (a, b) -> Integer.compare(b.first, a.first));
    private static class Pair<F, S> {

        private F first;

        private S second;

        public Pair() {}

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }
    }
    static long power(long x, long y, long p)
    {
        // Initialize result
        long res = 1;

        // Update x if it is more
        // than or equal to p
        x = x % p;

        while (y > 0)
        {
            // If y is odd, multiply x
            // with result
            if((y & 1)==1)
                res = (res * x) % p;

            // y must be even now
            // y = y / 2
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
	public void run()
	{
		InputReader sc = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		int t = sc.nextInt();
		while(t--!=0)
		{
		    String s = sc.next();
		    HashMap<Character,Integer> map = new HashMap<Character,Integer>();
		    int n = s.length();
		    String ans = "";
		    for(int i=0;i<n;i++)
		    {
		        if(i+1<n && s.charAt(i)==s.charAt(i+1))
		            i++;
		        else
		        {
		            if(!map.containsKey(s.charAt(i)))
		            {
		                ans += Character.toString(s.charAt(i));
		                map.put(s.charAt(i),0);
		            }
		        }
		    }
		    System.out.println(sortString(ans));
		}
	}
}


import java.lang.reflect.Array;
import java.util.*; import java.io.*; import java.math.*;

public class Main {
    static Reader scan = new Reader(); static Scanner scan2 = new Scanner(System.in);
    static int MAX = 11111, MAX_BUCKET = 111, lim = 100000000;
    static long[] tree = new long[4*MAX+1];
    public static void main(String[] args) throws IOException{

        int t=  scan2.nextInt();
        while(t-->0){
            char[] arr = scan2.next().toCharArray();

            HashMap<Character, Integer> map = new HashMap<>(); ArrayList<Character> temp = new ArrayList<>();
            int i =0 ;
            while(i < arr.length-1){
                if(arr[i] != arr[i+1] && !map.containsKey(arr[i])){temp.add(arr[i]); map.put(arr[i], 1); i+= 1;}
                else{i +=2;}
            }
            if(arr.length >= 2 && arr[arr.length-1] != arr[arr.length-2] && !map.containsKey(arr[arr.length-1])){temp.add(arr[arr.length-1]);}
            if(arr.length == 1){temp.add(arr[0]);}
            Collections.sort(temp);
            for(char ch : temp){
                System.out.print(ch);
            }System.out.println();
        }

    }

    static ArrayList<ArrayList<Integer>> shot = new ArrayList<>();

    public static void solve(int[] freq, int n, int d, int[] answer){
        if(d <= n){
            ArrayList<Integer> par = new ArrayList<>();
            for(int i=0; i<d; i++){par.add(answer[i]);}
            shot.add(par);
            if(d == n){return;}
        }
        for(int i=0; i<freq.length; i++){
            if(freq[i] == 0){continue;}
            freq[i]--; answer[d] = i;
            solve(freq, n, d+1, answer);
            freq[i]++;
        }
    }

    public static long solve(int index, long[] arr, long[] brr, int n, int m, int curr, long[][] dp, boolean[][] mask){
        if((curr == 0 && index == n) || (curr == 1 && index == m)) {return 0;}
        else if(mask[curr][index]){return dp[curr][index];}
        else{
            long answer =0 ;
            if(curr == 0){
                answer = arr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(brr, arr[index]);
                if(i != -1){
                    //System.out.println("b"+ i + " " +arr[index]);
                    answer = Long.max(answer, brr[i]+solve(i+1, arr, brr, n,m,1, dp, mask));
                    dp[1][i] = answer; mask[1][index] = true;
                }
            }else{
                answer = brr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(arr, brr[index]);
                if(i != -1){
                    //System.out.println("a"+ i + " " +brr[index]);
                    answer = Long.max(answer, arr[i]+solve(i+1, arr, brr, n,m,0, dp, mask));
                    dp[0][i] = answer; mask[0][index] = true;
                }
            }
            mask[curr][index] = true;
            dp[curr][index] = answer;
            return answer;
        }
    }

    public static int bin(long[] arr, long key){
        int l = 0, r = arr.length-1, mid = (l+r)>>1;
        while(l <= r){
            if(l == r){if(arr[l] == key){return l;} return -1;}
            else if(r-l == 1){if(arr[l] == key){return l;} if(arr[r] == key){return r;} return -1;}
            else{
                mid = (l+r)>>1; if(arr[mid] == key){return mid;}
                else if(arr[mid] > key){r = mid-1;}
                else{l = mid+1;}
            }
        }
        return -1;
    }

    public static void add(HashMap<Integer, HashMap<Integer, Integer>> m, int a, int b, int w){
        m.get(a).put(b,w); m.get(b).put(a, w);
    }

    public static long solve(int index, long[] arr, long[] brr, int t, long[][] dp, boolean[][] mask, HashMap<Long, pair> map){
        //System.out.println(index+" "+map+" "+t);
        if((t == 0 && index == arr.length) || (t==1 && index == brr.length)){return 0;}
        else if(mask[t][index]){return dp[t][index];}
        else{
            long answer = 0;
            if(t == 0){
                answer = arr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(arr[index])){
                    answer = Long.max(answer, brr[map.get(arr[index]).second]+solve(map.get(arr[index]).second+1, arr,brr, 1,dp, mask, map));
                    //dp[1][index] = answer; mask[1][index] = true;
                }
                dp[0][index] = answer; mask[0][index] = true;
            }else{
                answer = brr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(brr[index])){
                    answer = Long.max(answer, arr[map.get(brr[index]).first]+solve(map.get(brr[index]).first+1, arr,brr, 0,dp, mask, map));
                    //dp[0][index] = answer; mask[0][index] = true;
                }
                dp[1][index] = answer; mask[1][index] = true;
            }
            return answer;
        }
    }

    public static int[] dik(HashMap<Integer, HashMap<Integer, Integer>> g, int src, int n){
        PriorityQueue<pair> pq = new PriorityQueue<>(new comp());
        int[] answer = new int[n]; Arrays.fill(answer, MAX);
        pq.add(new pair(src, 0)); answer[src] = 0; boolean[] visited = new boolean[n];

        while (!pq.isEmpty()){
            System.out.println(pq);
            pair curr = pq.poll(); visited[curr.first] = true;
            if(answer[curr.first] > curr.second)
                answer[curr.first] = curr.second;
            for(int i : g.get(curr.first).keySet()){
                if(!visited[i] && answer[curr.first]+g.get(curr.first).get(i) < answer[i]){
                    pq.add(new pair(i, curr.second+g.get(curr.first).get(i)));
                }
            }
        }

        return answer;
    }

    static class pair{
        int first,second; pair(int first, int second){this.first=first;this.second=second;}
        public String toString(){
            return first+" "+second;
        }
    }
    static class comp implements Comparator<pair> {
        @Override
        public int compare(pair o1, pair o2) {
            if(o1.second == o2.second){return (int) (o1.first-o2.first);}
            return (int)(o1.second-o2.second);
        }
    };

    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

}


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

public class Main {
    static Reader scan = new Reader(); static Scanner scan2 = new Scanner(System.in);
    static int MAX = 11111, MAX_BUCKET = 111, lim = 100000000;
    static long[] tree = new long[4*MAX+1];
    public static void main(String[] args) throws IOException{

        int t=  scan2.nextInt();
        while(t-->0){
            char[] arr = scan2.next().toCharArray();
            boolean[] mask = new boolean[arr.length];
            int i= 0;
            while(i<arr.length-1){
                if(arr[i] == arr[i+1]){mask[i] = true; mask[i+1] = true; i+=2;}
                else{i+=1;}
            }

            ArrayList<Character> temp = new ArrayList<>();
            for(int j=0; j<mask.length; j++){
                if(!mask[j] && !temp.contains(arr[j])){temp.add(arr[j]);}
            }
            Collections.sort(temp);

            for(char ch : temp){
                System.out.print(ch);
            }System.out.println();

        }

    }

    static ArrayList<ArrayList<Integer>> shot = new ArrayList<>();

    public static void solve(int[] freq, int n, int d, int[] answer){
        if(d <= n){
            ArrayList<Integer> par = new ArrayList<>();
            for(int i=0; i<d; i++){par.add(answer[i]);}
            shot.add(par);
            if(d == n){return;}
        }
        for(int i=0; i<freq.length; i++){
            if(freq[i] == 0){continue;}
            freq[i]--; answer[d] = i;
            solve(freq, n, d+1, answer);
            freq[i]++;
        }
    }

    public static long solve(int index, long[] arr, long[] brr, int n, int m, int curr, long[][] dp, boolean[][] mask){
        if((curr == 0 && index == n) || (curr == 1 && index == m)) {return 0;}
        else if(mask[curr][index]){return dp[curr][index];}
        else{
            long answer =0 ;
            if(curr == 0){
                answer = arr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(brr, arr[index]);
                if(i != -1){
                    //System.out.println("b"+ i + " " +arr[index]);
                    answer = Long.max(answer, brr[i]+solve(i+1, arr, brr, n,m,1, dp, mask));
                    dp[1][i] = answer; mask[1][index] = true;
                }
            }else{
                answer = brr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(arr, brr[index]);
                if(i != -1){
                    //System.out.println("a"+ i + " " +brr[index]);
                    answer = Long.max(answer, arr[i]+solve(i+1, arr, brr, n,m,0, dp, mask));
                    dp[0][i] = answer; mask[0][index] = true;
                }
            }
            mask[curr][index] = true;
            dp[curr][index] = answer;
            return answer;
        }
    }

    public static int bin(long[] arr, long key){
        int l = 0, r = arr.length-1, mid = (l+r)>>1;
        while(l <= r){
            if(l == r){if(arr[l] == key){return l;} return -1;}
            else if(r-l == 1){if(arr[l] == key){return l;} if(arr[r] == key){return r;} return -1;}
            else{
                mid = (l+r)>>1; if(arr[mid] == key){return mid;}
                else if(arr[mid] > key){r = mid-1;}
                else{l = mid+1;}
            }
        }
        return -1;
    }

    public static void add(HashMap<Integer, HashMap<Integer, Integer>> m, int a, int b, int w){
        m.get(a).put(b,w); m.get(b).put(a, w);
    }

    public static long solve(int index, long[] arr, long[] brr, int t, long[][] dp, boolean[][] mask, HashMap<Long, pair> map){
        //System.out.println(index+" "+map+" "+t);
        if((t == 0 && index == arr.length) || (t==1 && index == brr.length)){return 0;}
        else if(mask[t][index]){return dp[t][index];}
        else{
            long answer = 0;
            if(t == 0){
                answer = arr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(arr[index])){
                    answer = Long.max(answer, brr[map.get(arr[index]).second]+solve(map.get(arr[index]).second+1, arr,brr, 1,dp, mask, map));
                    //dp[1][index] = answer; mask[1][index] = true;
                }
                dp[0][index] = answer; mask[0][index] = true;
            }else{
                answer = brr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(brr[index])){
                    answer = Long.max(answer, arr[map.get(brr[index]).first]+solve(map.get(brr[index]).first+1, arr,brr, 0,dp, mask, map));
                    //dp[0][index] = answer; mask[0][index] = true;
                }
                dp[1][index] = answer; mask[1][index] = true;
            }
            return answer;
        }
    }

    public static int[] dik(HashMap<Integer, HashMap<Integer, Integer>> g, int src, int n){
        PriorityQueue<pair> pq = new PriorityQueue<>(new comp());
        int[] answer = new int[n]; Arrays.fill(answer, MAX);
        pq.add(new pair(src, 0)); answer[src] = 0; boolean[] visited = new boolean[n];

        while (!pq.isEmpty()){
            System.out.println(pq);
            pair curr = pq.poll(); visited[curr.first] = true;
            if(answer[curr.first] > curr.second)
                answer[curr.first] = curr.second;
            for(int i : g.get(curr.first).keySet()){
                if(!visited[i] && answer[curr.first]+g.get(curr.first).get(i) < answer[i]){
                    pq.add(new pair(i, curr.second+g.get(curr.first).get(i)));
                }
            }
        }

        return answer;
    }

    static class pair{
        int first,second; pair(int first, int second){this.first=first;this.second=second;}
        public String toString(){
            return first+" "+second;
        }
    }
    static class comp implements Comparator<pair> {
        @Override
        public int compare(pair o1, pair o2) {
            if(o1.second == o2.second){return (int) (o1.first-o2.first);}
            return (int)(o1.second-o2.second);
        }
    };

    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

}


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

public class Main {
    static Reader scan = new Reader(); static Scanner scan2 = new Scanner(System.in);
    static int MAX = 11111, MAX_BUCKET = 111, lim = 100000000;
    static long[] tree = new long[4*MAX+1];
    public static void main(String[] args) throws IOException{

        int t=  scan2.nextInt();
        while(t-->0){
            char[] arr = scan2.next().toCharArray();

            HashMap<Character, Integer> map = new HashMap<>(); ArrayList<Character> temp = new ArrayList<>();
            int i =0 ;
            while(i < arr.length-1){
                if(arr[i] != arr[i+1] && !map.containsKey(arr[i])){temp.add(arr[i]); map.put(arr[i], 1); i+= 1;}
                else if(map.containsKey(arr[i])){i+=1;}
                else{i +=2;}
            }
            if(arr.length >= 2 && arr[arr.length-1] != arr[arr.length-2] && !map.containsKey(arr[arr.length-1])){temp.add(arr[arr.length-1]);}
            if(arr.length == 1){temp.add(arr[0]);}
            Collections.sort(temp);

            for(char ch : temp){
                System.out.print(ch);
            }System.out.println();
        }

    }

    static ArrayList<ArrayList<Integer>> shot = new ArrayList<>();

    public static void solve(int[] freq, int n, int d, int[] answer){
        if(d <= n){
            ArrayList<Integer> par = new ArrayList<>();
            for(int i=0; i<d; i++){par.add(answer[i]);}
            shot.add(par);
            if(d == n){return;}
        }
        for(int i=0; i<freq.length; i++){
            if(freq[i] == 0){continue;}
            freq[i]--; answer[d] = i;
            solve(freq, n, d+1, answer);
            freq[i]++;
        }
    }

    public static long solve(int index, long[] arr, long[] brr, int n, int m, int curr, long[][] dp, boolean[][] mask){
        if((curr == 0 && index == n) || (curr == 1 && index == m)) {return 0;}
        else if(mask[curr][index]){return dp[curr][index];}
        else{
            long answer =0 ;
            if(curr == 0){
                answer = arr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(brr, arr[index]);
                if(i != -1){
                    //System.out.println("b"+ i + " " +arr[index]);
                    answer = Long.max(answer, brr[i]+solve(i+1, arr, brr, n,m,1, dp, mask));
                    dp[1][i] = answer; mask[1][index] = true;
                }
            }else{
                answer = brr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(arr, brr[index]);
                if(i != -1){
                    //System.out.println("a"+ i + " " +brr[index]);
                    answer = Long.max(answer, arr[i]+solve(i+1, arr, brr, n,m,0, dp, mask));
                    dp[0][i] = answer; mask[0][index] = true;
                }
            }
            mask[curr][index] = true;
            dp[curr][index] = answer;
            return answer;
        }
    }

    public static int bin(long[] arr, long key){
        int l = 0, r = arr.length-1, mid = (l+r)>>1;
        while(l <= r){
            if(l == r){if(arr[l] == key){return l;} return -1;}
            else if(r-l == 1){if(arr[l] == key){return l;} if(arr[r] == key){return r;} return -1;}
            else{
                mid = (l+r)>>1; if(arr[mid] == key){return mid;}
                else if(arr[mid] > key){r = mid-1;}
                else{l = mid+1;}
            }
        }
        return -1;
    }

    public static void add(HashMap<Integer, HashMap<Integer, Integer>> m, int a, int b, int w){
        m.get(a).put(b,w); m.get(b).put(a, w);
    }

    public static long solve(int index, long[] arr, long[] brr, int t, long[][] dp, boolean[][] mask, HashMap<Long, pair> map){
        //System.out.println(index+" "+map+" "+t);
        if((t == 0 && index == arr.length) || (t==1 && index == brr.length)){return 0;}
        else if(mask[t][index]){return dp[t][index];}
        else{
            long answer = 0;
            if(t == 0){
                answer = arr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(arr[index])){
                    answer = Long.max(answer, brr[map.get(arr[index]).second]+solve(map.get(arr[index]).second+1, arr,brr, 1,dp, mask, map));
                    //dp[1][index] = answer; mask[1][index] = true;
                }
                dp[0][index] = answer; mask[0][index] = true;
            }else{
                answer = brr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(brr[index])){
                    answer = Long.max(answer, arr[map.get(brr[index]).first]+solve(map.get(brr[index]).first+1, arr,brr, 0,dp, mask, map));
                    //dp[0][index] = answer; mask[0][index] = true;
                }
                dp[1][index] = answer; mask[1][index] = true;
            }
            return answer;
        }
    }

    public static int[] dik(HashMap<Integer, HashMap<Integer, Integer>> g, int src, int n){
        PriorityQueue<pair> pq = new PriorityQueue<>(new comp());
        int[] answer = new int[n]; Arrays.fill(answer, MAX);
        pq.add(new pair(src, 0)); answer[src] = 0; boolean[] visited = new boolean[n];

        while (!pq.isEmpty()){
            System.out.println(pq);
            pair curr = pq.poll(); visited[curr.first] = true;
            if(answer[curr.first] > curr.second)
                answer[curr.first] = curr.second;
            for(int i : g.get(curr.first).keySet()){
                if(!visited[i] && answer[curr.first]+g.get(curr.first).get(i) < answer[i]){
                    pq.add(new pair(i, curr.second+g.get(curr.first).get(i)));
                }
            }
        }

        return answer;
    }

    static class pair{
        int first,second; pair(int first, int second){this.first=first;this.second=second;}
        public String toString(){
            return first+" "+second;
        }
    }
    static class comp implements Comparator<pair> {
        @Override
        public int compare(pair o1, pair o2) {
            if(o1.second == o2.second){return (int) (o1.first-o2.first);}
            return (int)(o1.second-o2.second);
        }
    };

    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

}


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

public class Main {
    static Reader scan = new Reader(); static Scanner scan2 = new Scanner(System.in);
    static int MAX = 11111, MAX_BUCKET = 111, lim = 100000000;
    static long[] tree = new long[4*MAX+1];
    public static void main(String[] args) throws IOException{

        int t=  scan2.nextInt();
        while(t-->0){
            char[] arr = scan2.next().toCharArray();
            boolean[] mask = new boolean[arr.length];
            int i= 0;
            while(i<arr.length-1){
                if(arr[i] == arr[i+1]){mask[i] = true; mask[i+1] = true; i+=2;}
                else{i+=1;}
            }

            ArrayList<Character> temp = new ArrayList<>();
            for(int j=0; j<mask.length; j++){
                if(!mask[j]){temp.add(arr[j]);}
            }
            Collections.sort(temp);

            for(char ch : temp){
                System.out.print(ch);
            }System.out.println();

        }

    }

    static ArrayList<ArrayList<Integer>> shot = new ArrayList<>();

    public static void solve(int[] freq, int n, int d, int[] answer){
        if(d <= n){
            ArrayList<Integer> par = new ArrayList<>();
            for(int i=0; i<d; i++){par.add(answer[i]);}
            shot.add(par);
            if(d == n){return;}
        }
        for(int i=0; i<freq.length; i++){
            if(freq[i] == 0){continue;}
            freq[i]--; answer[d] = i;
            solve(freq, n, d+1, answer);
            freq[i]++;
        }
    }

    public static long solve(int index, long[] arr, long[] brr, int n, int m, int curr, long[][] dp, boolean[][] mask){
        if((curr == 0 && index == n) || (curr == 1 && index == m)) {return 0;}
        else if(mask[curr][index]){return dp[curr][index];}
        else{
            long answer =0 ;
            if(curr == 0){
                answer = arr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(brr, arr[index]);
                if(i != -1){
                    //System.out.println("b"+ i + " " +arr[index]);
                    answer = Long.max(answer, brr[i]+solve(i+1, arr, brr, n,m,1, dp, mask));
                    dp[1][i] = answer; mask[1][index] = true;
                }
            }else{
                answer = brr[index]+solve(index+1, arr,brr,n,m,curr, dp, mask);
                int i = bin(arr, brr[index]);
                if(i != -1){
                    //System.out.println("a"+ i + " " +brr[index]);
                    answer = Long.max(answer, arr[i]+solve(i+1, arr, brr, n,m,0, dp, mask));
                    dp[0][i] = answer; mask[0][index] = true;
                }
            }
            mask[curr][index] = true;
            dp[curr][index] = answer;
            return answer;
        }
    }

    public static int bin(long[] arr, long key){
        int l = 0, r = arr.length-1, mid = (l+r)>>1;
        while(l <= r){
            if(l == r){if(arr[l] == key){return l;} return -1;}
            else if(r-l == 1){if(arr[l] == key){return l;} if(arr[r] == key){return r;} return -1;}
            else{
                mid = (l+r)>>1; if(arr[mid] == key){return mid;}
                else if(arr[mid] > key){r = mid-1;}
                else{l = mid+1;}
            }
        }
        return -1;
    }

    public static void add(HashMap<Integer, HashMap<Integer, Integer>> m, int a, int b, int w){
        m.get(a).put(b,w); m.get(b).put(a, w);
    }

    public static long solve(int index, long[] arr, long[] brr, int t, long[][] dp, boolean[][] mask, HashMap<Long, pair> map){
        //System.out.println(index+" "+map+" "+t);
        if((t == 0 && index == arr.length) || (t==1 && index == brr.length)){return 0;}
        else if(mask[t][index]){return dp[t][index];}
        else{
            long answer = 0;
            if(t == 0){
                answer = arr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(arr[index])){
                    answer = Long.max(answer, brr[map.get(arr[index]).second]+solve(map.get(arr[index]).second+1, arr,brr, 1,dp, mask, map));
                    //dp[1][index] = answer; mask[1][index] = true;
                }
                dp[0][index] = answer; mask[0][index] = true;
            }else{
                answer = brr[index]+solve(index+1, arr,brr, t, dp, mask, map);
                if(map.containsKey(brr[index])){
                    answer = Long.max(answer, arr[map.get(brr[index]).first]+solve(map.get(brr[index]).first+1, arr,brr, 0,dp, mask, map));
                    //dp[0][index] = answer; mask[0][index] = true;
                }
                dp[1][index] = answer; mask[1][index] = true;
            }
            return answer;
        }
    }

    public static int[] dik(HashMap<Integer, HashMap<Integer, Integer>> g, int src, int n){
        PriorityQueue<pair> pq = new PriorityQueue<>(new comp());
        int[] answer = new int[n]; Arrays.fill(answer, MAX);
        pq.add(new pair(src, 0)); answer[src] = 0; boolean[] visited = new boolean[n];

        while (!pq.isEmpty()){
            System.out.println(pq);
            pair curr = pq.poll(); visited[curr.first] = true;
            if(answer[curr.first] > curr.second)
                answer[curr.first] = curr.second;
            for(int i : g.get(curr.first).keySet()){
                if(!visited[i] && answer[curr.first]+g.get(curr.first).get(i) < answer[i]){
                    pq.add(new pair(i, curr.second+g.get(curr.first).get(i)));
                }
            }
        }

        return answer;
    }

    static class pair{
        int first,second; pair(int first, int second){this.first=first;this.second=second;}
        public String toString(){
            return first+" "+second;
        }
    }
    static class comp implements Comparator<pair> {
        @Override
        public int compare(pair o1, pair o2) {
            if(o1.second == o2.second){return (int) (o1.first-o2.first);}
            return (int)(o1.second-o2.second);
        }
    };

    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

}


import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args)throws IOException
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int test = Integer.parseInt(in.readLine());
        String str;
        while(test-->0)
        {
            str = in.readLine();
            brokenKeyboard(str);
            System.out.println();
        }
    }
    private static void brokenKeyboard(String x)
    {
        boolean[] check = new boolean[26];
        char[] str = x.toCharArray();
        for(int i=0;i<str.length;i+=1)
        {
            int j = i;
            while(j+1 < str.length && str[j+1] == str[i])
                j++;
            if((j-i)%2 == 0)
                check[str[i]-'a'] = true;
            i = j;
        }
        for(int i=0;i<26;i+=1)
            if(check[i])
                System.out.print((char)('a'+i));
    }
}