/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author abetrack3
 */

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

public class ProblemF
{

    public static int zero, one, two;
    public static ArrayList<Integer>arr;

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int test = sc.nextInt();
        while (test --> 0)
        {
            zero = sc.nextInt(); one = sc.nextInt(); two = sc.nextInt();
            if(zero == 1+one & one == 1+two & two == 9)
            {
                System.out.println("wrong asnwer");
                continue;
            }
            arr = new ArrayList<Integer>();
            addZero();
            addOne();
            addTwo();
            for(int x : arr) System.out.print(x);
            System.out.println();
        }
    }

    public static void addZero()
    {
        if(zero == 0) return;
        arr.add(0);
        arr.add(0);
        while (0 <-- zero)
            arr.add(0);
    }

    public static void addOne()
    {
        if(one == 0) return;
        arr.add(1);
        if(arr.size() == 1) arr.add(0);
        while(0 <-- one)
        {
            if(arr.get(arr.size() - 1) == 0) arr.add(1);
            else arr.add(0);
        }
    }

    public static void addTwo()
    {
        if(two == 0) return;
        if(arr.size() == 0) arr.add(1);
        while (two -- > 0)
        {
            if(arr.get(arr.size()-1)==1) arr.add(1);
            else arr.add(arr.size()-1, 1);
        }
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author abetrack3
 */

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

public class ProblemF
{

    public static int zero, one, two;
    public static ArrayList<Integer>arr;

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int test = sc.nextInt();
        while (test --> 0)
        {
            zero = sc.nextInt(); one = sc.nextInt(); two = sc.nextInt();
            arr = new ArrayList<Integer>();
            addZero();
            addOne();
            addTwo();
            for(int x : arr) System.out.print(x);
            System.out.println();
        }
    }

    public static void addZero()
    {
        if(zero == 0) return;
        arr.add(0);
        arr.add(0);
        while (0 <-- zero)
            arr.add(0);
    }

    public static void addOne()
    {
        if(one == 0) return;
        arr.add(1);
        if(arr.size() == 1) arr.add(0);
        while(0 <-- one)
        {
            if(arr.get(arr.size() - 1) == 0) arr.add(1);
            else arr.add(0);
        }
    }

    public static void addTwo()
    {
        if(two == 0) return;
        if(arr.size() == 0) arr.add(1);
        while (two -- > 0)
        {
            if(arr.get(arr.size()-1)==1) arr.add(1);
            else arr.add(arr.size()-1, 1);
        }
    }

}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author abetrack3
 */

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

public class ProblemF
{

    public static int zero, one, two;
    public static ArrayList<Integer>arr;

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int test = sc.nextInt();
        while (test --> 0)
        {
            zero = sc.nextInt(); one = sc.nextInt(); two = sc.nextInt();
            if(zero == one & one == two & two == 9)
            {
                System.out.println("wrong asnwer");
                continue;
            }
            arr = new ArrayList<Integer>();
            addZero();
            addOne();
            addTwo();
            for(int x : arr) System.out.print(x);
            System.out.println();
        }
    }

    public static void addZero()
    {
        if(zero == 0) return;
        arr.add(0);
        arr.add(0);
        while (0 <-- zero)
            arr.add(0);
    }

    public static void addOne()
    {
        if(one == 0) return;
        arr.add(1);
        if(arr.size() == 1) arr.add(0);
        while(0 <-- one)
        {
            if(arr.get(arr.size() - 1) == 0) arr.add(1);
            else arr.add(0);
        }
    }

    public static void addTwo()
    {
        if(two == 0) return;
        if(arr.size() == 0) arr.add(1);
        while (two -- > 0)
        {
            if(arr.get(arr.size()-1)==1) arr.add(1);
            else arr.add(arr.size()-1, 1);
        }
    }

}


import java.io.*;
import java.math.*;
import java.util.*;
public class BinaryStringReconstruction {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int T = input.nextInt();
		for (int i = 1; i <= T; i++) {
			int ZERO = input.nextInt();
			int ONE = input.nextInt();
			int TWO = input.nextInt();
			String ans = "";
			for (int j = 0; j <= TWO; j++) {
				ans+="1";
			}
			for (int j = 0; j <= ZERO; j++) {
				ans+="0";
			}
			ONE--; //Connector uses up one such substring
			for (int j = 0; j < ONE; j++) {
				if (j%2==0) ans+="1";
				else ans+="0";
			}
			System.out.println(ans);
		}
	}
}


import java.io.*;
import java.math.*;
import java.util.*;
public class BinaryStringReconstruction {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int T = input.nextInt();
		for (int i = 1; i <= T; i++) {
			int ZERO = input.nextInt();
			int ONE = input.nextInt();
			int TWO = input.nextInt();
			String ans = "";
			if (TWO>0) {
				for (int j = 0; j <= TWO; j++) {
					ans+="1";
				}
			}
			if (ZERO>0) {
				for (int j = 0; j <= ZERO; j++) {
					ans+="0";
				}
			}
			if (TWO>0&&ZERO>0) {
				ONE--; //Connector uses up one such substring
				for (int j = 0; j < ONE; j++) {
					if (j%2==0) ans+="1";
					else ans+="0";
				}
			}else if (ZERO>0) {
				ONE--; //Connector uses up one such substring
				for (int j = 0; j <= ONE; j++) {
					if (j%2==0) ans+="1";
					else ans+="0";
				}
			}else if (TWO>0) {
				ONE--; //Connector uses up one such substring
				for (int j = 0; j <= ONE; j++) {
					if (j%2==0) ans+="0";
					else ans+="1";
				}
			}else {
				ans+="01";
				ONE--;
				for (int j = 0; j < ONE; j++) {
					if (j%2==0) ans+="0";
					else ans+="1";
				}
			}
			System.out.println(ans);
		}
	}
}


import java.io.*;
import java.math.*;
import java.util.*;
public class BinaryStringReconstruction {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int T = input.nextInt();
		for (int i = 1; i <= T; i++) {
			int ZERO = input.nextInt();
			int ONE = input.nextInt();
			int TWO = input.nextInt();
			String ans = "";
			if (TWO>0) {
				for (int j = 0; j <= TWO; j++) {
					ans+="1";
				}
			}
			if (ZERO>0) {
				for (int j = 0; j <= ZERO; j++) {
					ans+="0";
				}
			}
			ONE--; //Connector uses up one such substring
			for (int j = 0; j < ONE; j++) {
				if (j%2==0) ans+="1";
				else ans+="0";
			}
			System.out.println(ans);
		}
	}
}


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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(in, out);
        out.close();
    }

    static class Solve {
    	public int jugada(int leftI, int rigI, int max, int torn) {
    		int puntos = 0;
    		return puntos;
    	}
    	public void solve(InputReader in, OutputWriter out) {
    		for(int i = in.nextInt();i>0;i--) {
    			int z = in.nextInt();
    			int db = in.nextInt();
    			int u = in.nextInt();
    			StringBuilder pepe = new StringBuilder();
    			if(z>0) pepe.append('0');
    			else pepe.append('1');
    			while(z>0) {
    				pepe.append('0');
    				z--;
    			}
    			if(u>0) {
    				pepe.append(1);
    				db--;
    				while(u>0) {
        				pepe.append('1');
        				u--;
        			}
    			}
    			while(db>0) {
    				if(pepe.charAt(pepe.length()-1)=='1')pepe.append('0');
    				else pepe.append('1');
    				db--;
    			}
    			System.out.println(pepe.toString());
    		}
    	}
    }

    static class Graph {
        int N;
        HashMap<Integer, LinkedList<Integer>> adyacentList;
        public Graph(int N) {
            this.N = N;
            adyacentList = new HashMap<>();
            for (Integer i = 1; i <= N; i++) {
                adyacentList.put(i, new LinkedList<Integer>());
            }
        }
        void addEdge(int node, int v) {
            this.adyacentList.get(node).add(v);
            this.adyacentList.get(v).add(node);
        }
        void bfs(int x, boolean[] visited) {
            LinkedList<Integer> queue = new LinkedList<>();
            queue.add(x);
            visited[x] = true;
            while (!queue.isEmpty()) {
                LinkedList<Integer> list = this.adyacentList.get(queue.poll());
                for (Integer n : list) {
                    if (!visited[n]) {
                        visited[n] = true;
                        queue.add(n);
                    }
                }
            }
        }
        void dfs(int x, boolean[] visited) {
            visited[x] = true;
            LinkedList<Integer> list = this.adyacentList.get(x);
            for (Integer n : list) {
                if (!visited[n]) {
                    visited[n] = true;
                    dfs(n, visited);
                }
            }
        }
    }

    static class OutputWriter {
	    private final PrintWriter writer;

	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }

	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }

	    public void close() {
	        writer.close();
	    }

	    public void println(String string) {
	        writer.println(string);
	    }

	    public void println(int number) {
	        writer.println(number);
	    }

	    public void println(long number) {
	        writer.println(number);
	    }

	    public void print(long number) {
	        writer.print(number);
	    }

	    public void print(int number) {
	        writer.print(number);
	    }

	    public void print(String string) {
	        writer.print(string);
	    }
	}

	static class InputReader {
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

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

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

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

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}


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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Solve solver = new Solve();
        solver.solve(in, out);
        out.close();
    }

    static class Solve {
    	public int jugada(int leftI, int rigI, int max, int torn) {
    		int puntos = 0;
    		return puntos;
    	}
    	public void solve(InputReader in, OutputWriter out) {
    		for(int i = in.nextInt();i>0;i--) {
    			int z = in.nextInt();
    			int db = in.nextInt();
    			int u = in.nextInt();
    			StringBuilder pepe = new StringBuilder();
    			if(z>0) pepe.append('0');
    			else pepe.append('1');
    			while(z>0) {
    				pepe.append('0');
    				z--;
    			}
    			if(u>0) {
    				if(pepe.charAt(pepe.length()-1)=='0') {
	    				pepe.append(1);
	    				db--;
    				}
    				while(u>0) {
        				pepe.append('1');
        				u--;
        			}
    			}
    			while(db>0) {
    				if(pepe.charAt(pepe.length()-1)=='1')pepe.append('0');
    				else pepe.append('1');
    				db--;
    			}
    			System.out.println(pepe.toString());
    		}
    	}
    }

    static class Graph {
        int N;
        HashMap<Integer, LinkedList<Integer>> adyacentList;
        public Graph(int N) {
            this.N = N;
            adyacentList = new HashMap<>();
            for (Integer i = 1; i <= N; i++) {
                adyacentList.put(i, new LinkedList<Integer>());
            }
        }
        void addEdge(int node, int v) {
            this.adyacentList.get(node).add(v);
            this.adyacentList.get(v).add(node);
        }
        void bfs(int x, boolean[] visited) {
            LinkedList<Integer> queue = new LinkedList<>();
            queue.add(x);
            visited[x] = true;
            while (!queue.isEmpty()) {
                LinkedList<Integer> list = this.adyacentList.get(queue.poll());
                for (Integer n : list) {
                    if (!visited[n]) {
                        visited[n] = true;
                        queue.add(n);
                    }
                }
            }
        }
        void dfs(int x, boolean[] visited) {
            visited[x] = true;
            LinkedList<Integer> list = this.adyacentList.get(x);
            for (Integer n : list) {
                if (!visited[n]) {
                    visited[n] = true;
                    dfs(n, visited);
                }
            }
        }
    }

    static class OutputWriter {
	    private final PrintWriter writer;

	    public OutputWriter(OutputStream outputStream) {
	        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	    }

	    public OutputWriter(Writer writer) {
	        this.writer = new PrintWriter(writer);
	    }

	    public void close() {
	        writer.close();
	    }

	    public void println(String string) {
	        writer.println(string);
	    }

	    public void println(int number) {
	        writer.println(number);
	    }

	    public void println(long number) {
	        writer.println(number);
	    }

	    public void print(long number) {
	        writer.print(number);
	    }

	    public void print(int number) {
	        writer.print(number);
	    }

	    public void print(String string) {
	        writer.print(string);
	    }
	}

	static class InputReader {
		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public String nextLine() {
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (b!=10) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

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

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

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

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        int cnt=1;
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
            }
            if(o!=0)
            {
                if(c==1)
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last = "0";
                        }
                        else
                        {
                            sb.append("1");
                            last = "1";
                        }
                    }
                }
                else
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("1");
                            last="1";
                        }
                        else
                        {
                            sb.append("0");
                            last="0";
                        }
                    }
                }
            }
            if(z!=0)
            {
                if(last.equals("1"))
                {
                    for(int i=0;i<=z;i++)
                        sb.append("0");
                }
                else
                    for(int i=0;i<z;i++)
                        sb.append("0");
            }
            //if(cnt==101)
              //  out.println("---------- "+z+" "+o+" "+tw+" "+sb);

            cnt++;
            out.println(sb);
            out.flush();
        }
    }
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        int cnt=1;
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
            }
            if(o!=0)
            {
                if(c==1)
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last = "0";
                        }
                        else
                        {
                            sb.append("1");
                            last = "1";
                        }
                    }
                }
                else
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last="0";
                        }
                        else
                        {
                            sb.append("1");
                            last="1";
                        }
                    }
                }
            }
            if(z!=0)
            {
                if(last.equals("1"))
                {
                    for(int i=0;i<=z;i++)
                        sb.append("0");
                }
                else
                    for(int i=0;i<z;i++)
                        sb.append("0");
            }
            if(cnt==101)
                out.println("---------- "+z+" "+o+" "+tw+" "+sb);

            cnt++;
            out.println(sb);
            out.flush();
        }
    }
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
            }
            if(o!=0)
            {
                if(c==1)
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last = "0";
                        }
                        else
                        {
                            sb.append("1");
                            last = "1";
                        }
                    }
                }
                else
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last="0";
                        }
                        else
                        {
                            sb.append("1");
                            last="1";
                        }
                    }
                }
            }
            if(z!=0)
            {
                if(last.equals("1"))
                {
                    for(int i=0;i<=z;i++)
                        sb.append("0");
                }
                else
                    for(int i=0;i<z;i++)
                        sb.append("0");
            }

            out.println(sb);
            out.flush();
        }
    }
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        int cnt=1;
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
            }
            if(o!=0)
            {
                if(c==1)
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last = "0";
                        }
                        else
                        {
                            sb.append("1");
                            last = "1";
                        }
                    }
                }
                else
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("1");
                            last="1";
                        }
                        else
                        {
                            sb.append("0");
                            last="0";
                        }
                    }
                }
            }
            if(z!=0)
            {
                if(last.equals("1"))
                {
                    for(int i=0;i<=z;i++)
                        sb.append("0");
                }
                else
                    for(int i=0;i<z;i++)
                        sb.append("0");
            }
            if(cnt==111)
                out.println("---------- "+z+" "+o+" "+tw+" "+sb);

            cnt++;
            out.println(sb);
            out.flush();
        }
    }
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        int cnt=1;
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
                last="1";
            }
            if(z!=0)
            {
                for(int i=0;i<=z;i++)
                    sb.append("0");
                if(c==1)
                    o--;
                c++;
                last="0";
            }

            if(o!=0)
            {
                if(c==0)
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                            sb.append("0");
                        else
                            sb.append("1");
                    }
                }
                else if(c==1)
                {
                    if(last.equals("0"))
                    {
                        for(int i=0;i<o;i++)
                        {
                            if(i%2==0)
                                sb.append("1");
                            else
                                sb.append("0");
                        }
                    }
                    else
                    {
                        for(int i=0;i<o;i++)
                        {
                            if(i%2==0)
                                sb.append("0");
                            else
                                sb.append("1");
                        }
                    }
                }
                else
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                            sb.append("1");
                        else
                            sb.append("0");
                    }
                }
            }
            //if(cnt==111)
              //  out.println("---------- "+z+" "+o+" "+tw+" "+sb);

            //cnt++;
            out.println(sb);
            out.flush();
        }
    }
}


/*
    Aman Agarwal
    algo.java
*/

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

public class F
{
    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;
            }
    }

    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static int[] nai(int N,int start)throws IOException{int[]A=new int[N+start];for(int i=start;i!=(N+start);i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean isPrime(int number){if (number == 2 || number == 3){return true;}if (number % 2 == 0) {return false;}int sqrt = (int) Math.sqrt(number) + 1;for(int i = 3; i < sqrt; i += 2){if (number % i == 0){return false;}}return true;}
    static int power(int n,int p){if(p==0)return 1;int a = power(n,p/2);a = a*a;int b = p & 1;if(b!=0){a =  n*a;}return a;}
    static long power(long n,long p){if(p==0)return 1;long a = power(n,p/2);a = a*a;long b = p & 1;if(b!=0){a =  n*a;}return a;}
    static void reverse(int[] a) {int b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void reverse(long[] a) {long b;for (int i = 0, j = a.length - 1; i < j; i++, j--) {b = a[i];a[i] = a[j];a[j] = b;}}
    static void swap(int a[],int i,int j){int temp = a[i];a[i] = a[j];a[j] = temp;}
    static void swap(long a[],int i,int j){long temp = a[i];a[i] = a[j];a[j] = temp;}
    static int count(int n){int c=0;while(n>0){c++;n = n/10;}return c;}

    /*-------------------------Main Code Starts(algo.java)----------------------------------*/

    public static void main(String[] args) throws IOException
    {
        int t = 1;
        t = sc.nextInt();
        int cnt=1;
        while(t-- > 0)
        {
            int z = ni();
            int o = ni();
            int tw = ni();
            int c=0;
            String last = "1";

            if(cnt==101)
                out.println("---------- "+z+" "+o+" "+tw);
            StringBuilder sb = new StringBuilder("");

            if(tw!=0)
            {
                for(int i=0;i<=tw;i++)
                    sb.append("1");
                c++;
            }
            if(o!=0)
            {
                if(c==1)
                {
                    for(int i=0;i<o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last = "0";
                        }
                        else
                        {
                            sb.append("1");
                            last = "1";
                        }
                    }
                }
                else
                {
                    for(int i=0;i<=o;i++)
                    {
                        if(i%2==0)
                        {
                            sb.append("0");
                            last="0";
                        }
                        else
                        {
                            sb.append("1");
                            last="1";
                        }
                    }
                }
            }
            if(z!=0)
            {
                if(last.equals("1"))
                {
                    for(int i=0;i<=z;i++)
                        sb.append("0");
                }
                else
                    for(int i=0;i<z;i++)
                        sb.append("0");
            }

            cnt++;
            out.println(sb);
            out.flush();
        }
    }
}


import java.util.Scanner;

public class F {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while (t-- > 0) {
			int n1 = sc.nextInt();
			int n2 = sc.nextInt(), n = n2, h = 0;
			int n3 = sc.nextInt();
			int i = 0;
			boolean h1 = false;
			String arr[] = new String[n1 + n2 + n3 + 1];
			if (n2 != 0 || n3 != 0) {
				arr[i] = "1";
			} else
				arr[i] = "0";
			i++;
			while (n1 != 0 || n2 != 0 || n3 != 0) {
				if (n3 != 0) {
					arr[i] = "1";
					n3--;
					i++;
				} else if (n2 != 0) {
					if (n % 2 == 0 && !h1) {
						n2--;
						h1 = true;
					} else {
						if (h % 2 == 0) {
							arr[i] = "0";
							h++;
							n2--;
							i++;
						} else {
							arr[i] = "1";
							h++;
							n2--;
							i++;
						}
					}
				} else {
					arr[i] = "0";
					i++;
					n1--;
				}
			}
			if (h1) {
				arr[i] = "1";
			}
			for (int j = 0; j < arr.length; j++) {
				System.out.print(arr[j]);
			}
			System.out.println();
		}
	}
}


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

public class F {

	public static PrintWriter out;

	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));
		int t = sc.nextInt();
		while (t-- > 0) {
			int n1 = sc.nextInt(), n2 = sc.nextInt(), n3 = sc.nextInt();
			int n = n2, h = 0;
			int i = 0;
			boolean h1 = false;
			String arr[] = new String[n1 + n2 + n3 + 1];
			if (n2 != 0 || n3 != 0) {
				arr[i] = "1";
			} else
				arr[i] = "0";
			i++;
			while (n1 != 0 || n2 != 0 || n3 != 0) {
				if (n3 != 0) {
					arr[i] = "1";
					n3--;
					i++;
				} else if (n2 != 0) {
					if (n % 2 == 0 && !h1) {
						n2--;
						h1 = true;
					} else {
						if (h % 2 == 0) {
							arr[i] = "0";
							h++;
							n2--;
							i++;
						} else {
							arr[i] = "1";
							h++;
							n2--;
							i++;
						}
					}
				} else {
					arr[i] = "0";
					i++;
					n1--;
				}
			}
			if (h1) {
				arr[i] = "1";
			}
			for (int j = 0; j < arr.length; j++) {
				System.out.print(arr[j]);
			}
			System.out.println();
		}
		out.close();

	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

	}
}


import java.util.Scanner;

public class F {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while (t-- > 0) {
			int n1 = sc.nextInt();
			int n2 = sc.nextInt(), n = n2, h = 0;
			int n3 = sc.nextInt();
			int i = 0;
			boolean h1 = false;
			String arr[] = new String[n1 + n2 + n3 + 1];
			if (n2 != 0 || n3 != 0) {
				arr[i] = "1";
			} else
				arr[i] = "0";
			i++;
			while (n1 != 0 || n2 != 0 || n3 != 0) {
				if (n3 != 0) {
					arr[i] = "1";
					n3--;
					i++;
				} else if (n2 != 0) {
					if (n % 2 == 0) {
						n2--;
						h1 = true;
					} else {
						if (h % 2 == 0) {
							arr[i] = "0";
							h++;
							n2--;
							i++;
						} else {
							arr[i] = "1";
							h++;
							n2--;
							i++;
						}
					}
				} else {
					arr[i] = "0";
					i++;
					n1--;
				}
			}
			if (h1) {
				arr[i] = "1";
			}
			for (int j = 0; j < arr.length; j++) {
				System.out.print(arr[j]);
			}
			System.out.println();
		}
	}

}


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

/*
* @author: Ramanqul
* */
public class Main {
    private static boolean USE_TEST_CASES = true;

    private static void solve(MyScanner in, PrintWriter out) {
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int n3 = in.nextInt();

        StringBuilder sb = new StringBuilder();

        if (n2 == 0) {

            if (n1 > 0) {
                for (int i=0;i<=n1+n3;i++) {
                    out.print(0);
                }
            } else {
                for (int i=0;i<=n3;i++) {
                    out.print(1);
                }
            }

            out.println();
            return;
        }

        if (n3 > 0) {
            for (int i=0;i<=n3;i++) {
                sb.append(1);
            }
        }

        if (n2 > 0) {
            if (sb.length() == 0) {
                sb.append(1);
            }

            for (int i=0;i<n2;i++) {
                sb.append(i % 2);
            }
        }

        if (n1 > 0) {

            if (sb.length() > 0 && sb.charAt(sb.length()-1) == '0') {
                n1--;
            }

            for (int i=0;i<=n1;i++) {
                sb.append(0);
            }

        }

        out.println(sb);

    }

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(sc, out);
        }
        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class _ {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
}


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

/*
* @author: Ramanqul
* */
public class Main {
    private static boolean USE_TEST_CASES = true;

    private static void solve(MyScanner in, PrintWriter out) {
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int n3 = in.nextInt();

        StringBuilder sb = new StringBuilder();

        if (n3 > 0) {
            for (int i=0;i<=n3;i++) {
                sb.append("1");
            }
        }

        if (n2 > 0) {
            if (sb.length() == 0) {
                sb.append("1");
            }

            for (int i=0;i<n2;i++) {
                sb.append(i % 2);
            }
        }

        if (n1 > 0) {

            if (sb.length() > 0 && sb.charAt(sb.length()-1) == '0') {
                n1--;
            }

            for (int i=0;i<=n1;i++) {
                sb.append("0");
            }

        }

        out.println(sb);

    }

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(sc, out);
        }
        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class _ {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
}


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

/*
* @author: Ramanqul
* */
public class Main {
    private static boolean USE_TEST_CASES = true;

    private static void solve(MyScanner in, PrintWriter out) {
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int n3 = in.nextInt();

        if(n2==0) {
            if(n1 > 0) {
                for(int i=0;i<=n1;i++) {
                    out.print(0);
                }
            }
            if(n3 > 0) {
                for(int i=0;i<=n3;i++) {
                    out.print(1);
                }
            }
            out.println();
            return;
        }

        StringBuilder sb = new StringBuilder();

        if (n3 > 0) {
            for (int i=0;i<=n3;i++) {
                sb.append("1");
            }
        }

        if (n2 > 0) {
            if (sb.length() == 0) {
                sb.append("1");
            }

            for (int i=0;i<n2;i++) {
                sb.append(i % 2);
            }
        }

        if (n1 > 0) {

            if (sb.length() > 0 && sb.charAt(sb.length()-1) == '0') {
                n1--;
            }

            for (int i=0;i<=n1;i++) {
                sb.append("0");
            }

        }

        out.println(sb);

    }

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(sc, out);
        }
        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class _ {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
}


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

/*
* @author: Ramanqul
* */
public class Main {
    private static boolean USE_TEST_CASES = true;

    private static void solve(MyScanner in, PrintWriter out) {
        int n1 = in.nextInt(); //00
        int n2 = in.nextInt(); //01
        int n3 = in.nextInt(); //11

        StringBuilder ans = new StringBuilder();

        if (n2 == 0) {
            if (n1 > 0) {
                for (int i=0;i<n1+1;i++) {
                    ans.append(0);
                }
            } else {
                for (int i=0;i<n3+1;i++) {
                    ans.append(1);
                }
            }
        } else {

            for (int i=0;i<n2;i++) {
                ans.append(i%2);
            }

            for (int i=0;i<n1;i++) {
                ans.insert(0, 0);
            }

            for (int i=0;i<n3;i++) {
                ans.append(1);
            }

            if (n2 % 2 == 0) {
                ans.append(0);
            } else {
                ans.append(1);
            }

        }

        out.println(ans);

    }

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(sc, out);
        }
        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class _ {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
}


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

/*
* @author: Ramanqul
* */
public class Main {
    private static boolean USE_TEST_CASES = true;

    private static void solve(MyScanner in, PrintWriter out) {
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int n3 = in.nextInt();

        StringBuilder sb = new StringBuilder();

        if (n2 == 0) {

            if (n1 > 0) {
                for (int i=0;i<=n1;i++) {
                    out.print(0);
                }
            } else {
                for (int i=0;i<=n3;i++) {
                    out.print(1);
                }
            }

            out.println();
            return;
        }

        if (n3 > 0) {
            for (int i=0;i<=n3;i++) {
                sb.append(1);
            }
        }

        if (n2 > 0) {
            if (sb.length() == 0) {
                sb.append(1);
            }

            for (int i=0;i<n2;i++) {
                sb.append(i % 2);
            }
        }

        if (n1 > 0) {

            if (sb.length() > 0 && sb.charAt(sb.length()-1) == '0') {
                n1--;
            }

            for (int i=0;i<=n1;i++) {
                sb.append(0);
            }

        }

        out.println(sb);

    }

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int t = 1;

        if (USE_TEST_CASES) {
            t = sc.nextInt();
        }

        for (int i=0;i<t;i++) {
            solve(sc, out);
        }
        out.close();
    }

    private static class Pair<A,B> {
        public A first;
        public B second;
        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }
    }

    private static class Triple<A,B,C> {
        public A first;
        public B second;
        public C third;

        public Triple(A first, B second, C third) {
            this.first = first;
            this.second = second;
            this.third = third;
        }
    }

    private static class _ {
        public static void readArray(MyScanner in, int a[], int n) {
            for (int i=0;i<n;i++) {
                a[i] = in.nextInt();
            }
        }

        public static Pair<Integer, Integer>[] readIntPairs(MyScanner in, int n) {
            Pair[] pairs = new Pair[n];
            for (int i=0;i<n;i++) {
                int x = in.nextInt();
                int y = in.nextInt();
                pairs[i] = new Pair<Integer, Integer>(x, y);
            }

            return pairs;
        }

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

            return gcd(b%a, a);
        }

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

    private static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

    }
}


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

public class Train {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int t = sc.nextInt();
		for (int i = 0; i < t; i++) {
			int n0 = sc.nextInt();
			int n1 = sc.nextInt();
			int n2 = sc.nextInt();
			String res = finalString(n0, n1, n2);
			out.println(res);
		}
		out.flush();
		out.close();
	}

	private static String finalString(int n0, int n1, int n2) {
		String str = "";
		if (n0 != 0) {
			for (int i = 0; i < n0 + 1; i++) {
				str += "0";
			}
		}
		if (n2 != 0) {
			for (int i = 0; i < n2 + 1; i++) {
				str += "1";
			}
		}
		char c = '1';
		if (n1 != 0) {
			for (int i = (n0 == 0) && (n2 == 0) ? 0 : 1; i < n1; i++) {
				if (str.length() != 0) {
					c = str.charAt(str.length() - 1);
				} else {
					str += "10";
					continue;
				}
				if (c == '0')
					str += "1";
				else
					str += "0";
			}
		}
		return str;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


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

public class Train {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int t = sc.nextInt();
		for (int i = 0; i < t; i++) {
			int n0 = sc.nextInt();
			int n1 = sc.nextInt();
			int n2 = sc.nextInt();
			String res = finalString(n0, n1, n2);
			out.println(res);
		}
		out.flush();
		out.close();
	}

	private static String finalString(int n0, int n1, int n2) {
		String str = "";
		if (n0 != 0) {
			for (int i = 0; i < n0 + 1; i++) {
				str += "0";
			}
		}
		if (n2 != 0) {
			for (int i = 0; i < n2 + 1; i++) {
				str += "1";
			}
		}
		char c = '1';
		if (n1 != 0) {
			int i = 1;
			if (n0 == 0 && n2 == 0) {
				i = 0;
			} else if (n0 == 0) {
				i = 1;
				str += "0";
			} else if (n2 == 0) {
				i = 1;
				str += "1";
			}
			for (; i < n1; i++) {
				if (str.length() != 0) {
					c = str.charAt(str.length() - 1);
				} else {
					str += "10";
					continue;
				}
				if (c == '0')
					str += "1";
				else
					str += "0";
			}
		}
		return str;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Codeforces
{
    class Program : IDisposable
    {
        private static TextReader textReader = new StreamReader(Console.OpenStandardInput());
        private static TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());

        void Solve()
        {
            int ans = 0;
            var n = int.Parse(Console.ReadLine());//ReadInt();
            var sList = new List<string>();
            for (int i = 0; i < n; ++i)
            {
                sList.Add(Console.ReadLine());
            }
            for (int i = 'a'; i < 'z'; ++i)
            {
                for (int j = i + 1; j <= 'z'; ++j)
                {
                    var l = 0;
                    foreach (var s in sList)
                    {
                        var p = true;
                        foreach (var ch in s)
                        {
                            if (ch != i && ch != j)
                            {
                                p = false;
                                break;
                            }
                        }
                        if (p)
                            l += s.Length;
                    }
                    ans = Math.Max(ans, l);
                }
            }
            Console.WriteLine(ans);
            //Console.ReadLine();
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.Dispose();
        }

        #region Helpers

        private static int ReadInt()
        {
            return int.Parse(textReader.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(textReader.ReadLine());
        }

        private static int[] ReadIntArray()
        {
            return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        #endregion

        public void Dispose()
        {
            textReader.Close();
            textWriter.Close();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var dict = new Dictionary<HashSet<char>, int>();
            for (int i = 0; i < n; ++i)
            {
                var s = Console.ReadLine().ToCharArray().ToList();
                var diffLetters = s.Distinct();
                if (diffLetters.Count() <= 2)
                {
                    var set = new HashSet<char>();
                    foreach (var letter in diffLetters)
                    {
                        set.Add(letter);
                    }
                    if (dict.ContainsKey(set))
                    {
                        dict[set] += s.Count;
                    }
                    else if(set.Count == 1 && dict.Keys.Any(x=>x.Contains(set.First()))){
                        var dictItems = dict.Where(x=>x.Key.Contains(set.First())).ToList();
                        foreach (var item in dictItems)
                        {
                            dict[item.Key] += s.Count;
                        }
                    }
                    else if(set.Count == 2 && dict.Any(x => x.Key.Count == 1 && set.Contains(x.Key.First())))
                    {
                        var dictItems = dict.Where(x => x.Key.Count == 1 && set.Contains(x.Key.First())).ToList();
                        foreach (var item in dictItems)
                        {
                            dict.Add(set, item.Value + s.Count);
                        }
                    }
                    else {
                        dict.Add(set, s.Count);
                    }
                }
            }
            var res = dict.Count!=0 ? dict.Values.Max() : 0;
            Console.WriteLine(res);
            //Console.ReadLine();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Codeforces
{
    class MyComparer:IEqualityComparer<List<char>>
    {
        public bool Equals(List<char> x, List<char> y)
        {
            if (x.Count == y.Count)
            {
                var res = true;
                for (int i = 0; i < x.Count; ++i)
                {
                    if (x[i] != y[i])
                    {
                        res = false;
                        break;
                    }
                }
                return res;
            }
            return false;
        }

        public int GetHashCode(List<char> obj)
        {
            return base.GetHashCode();
        }
    }
    class Program : IDisposable
    {
        private static TextReader textReader = new StreamReader(Console.OpenStandardInput());
        private static TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());

        void Solve()
        {
            var n = int.Parse(Console.ReadLine());//ReadInt();
            var singleLetStr = new List<string>();
            var dict = new Dictionary<List<char>, int>(new MyComparer());
            for (int i = 0; i < n; ++i)
            {
                var s = Console.ReadLine();
                var diffLetters = s.Distinct().ToList();
                diffLetters.Sort();
                if(diffLetters.Count() == 1)
                    singleLetStr.Add(s);
                else if (diffLetters.Count() == 2)
                {

                    if (dict.ContainsKey(diffLetters))
                    {
                        dict[diffLetters] += s.Length;
                    }
                    else
                    {
                        dict.Add(diffLetters,s.Length);
                    }
                }
            }
            foreach (var s in singleLetStr)
            {
                if (dict.Keys.Any(x => x.Contains(s.First())))
                {
                    var dictItems = dict.Where(x => x.Key.Contains(s.First())).ToList();
                    foreach (var keyValuePair in dictItems)
                    {
                        dict[keyValuePair.Key] += s.Length;
                    }
                }
                else
                {
                    dict.Add(new List<char>(){s.First()},s.Length);
                }
            }
            var res = dict.Count == 0 ? 0 : dict.Values.Max();
            Console.WriteLine(res);
            //Console.ReadLine();
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.Dispose();
        }

        #region Helpers

        private static int ReadInt()
        {
            return int.Parse(textReader.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(textReader.ReadLine());
        }

        private static int[] ReadIntArray()
        {
            return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        #endregion

        public void Dispose()
        {
            textReader.Close();
            textWriter.Close();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var dict = new Dictionary<List<char>, int>(new ComparerMy());
            for (int i = 0; i < n; ++i)
            {
                var s = Console.ReadLine().ToCharArray().ToList();
                var diffLetters = s.Distinct();
                if (diffLetters.Count() <= 2 && diffLetters.Count() > 0)
                {
                    var set = new List<char>();
                    foreach (var letter in diffLetters)
                    {
                        set.Add(letter);
                    }
                    set.Sort();
                    if (dict.ContainsKey(set))
                    {
                        dict[set] += s.Count;
                    }
                    else if(set.Count == 1 && dict.Keys.Any(x=>x.Contains(set.First()))){
                        var dictItems = dict.Where(x=>x.Key.Contains(set.First())).ToList();
                        foreach (var item in dictItems)
                        {
                            dict[item.Key] += s.Count;
                        }
                    }
                    else if(set.Count == 2 && dict.Any(x => x.Key.Count == 1 && set.Contains(x.Key.First())))
                    {
                        var dictItems = dict.Where(x => x.Key.Count == 1 && set.Contains(x.Key.First())).ToList();
                        foreach (var item in dictItems)
                        {
                            if (!dict.ContainsKey(set))
                            {
                                dict.Add(set, item.Value + s.Count);
                            }
                            else
                            {
                                dict[set] += item.Value;
                            }
                        }
                    }
                    else {
                        dict.Add(set, s.Count);
                    }
                }
            }
            var res = dict.Count!=0 ? dict.Values.Max() : 0;
            Console.WriteLine(res);
            //Console.ReadLine();
        }
    }

    class ComparerMy : IEqualityComparer<List<char>>
    {
        public bool Equals(List<char> x, List<char> y)
        {
            if (x.Count == y.Count)
            {
                bool res = true;
                for (int i = 0; i < x.Count; ++i)
                {
                    if (x[i] != y[i])
                    {
                        res = false;
                        break;
                    }
                }
                return res;
            }
            return false;
        }

        public int GetHashCode(List<char> obj)
        {
            int hashcode = 0;
            foreach (var t in obj)
            {
                hashcode ^= t.GetHashCode();
            }
            return hashcode;
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Codeforces
{
    class MyComparer:IEqualityComparer<List<char>>
    {
        public bool Equals(List<char> x, List<char> y)
        {
            if (x.Count == y.Count)
            {
                var res = true;
                for (int i = 0; i < x.Count; ++i)
                {
                    if (x[i] != y[i])
                    {
                        res = false;
                        break;
                    }
                }
                return res;
            }
            return false;
        }

        public int GetHashCode(List<char> obj)
        {
            return base.GetHashCode();
        }
    }
    class Program : IDisposable
    {
        private static TextReader textReader = new StreamReader(Console.OpenStandardInput());
        private static TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());

        void Solve()
        {
            var n = int.Parse(Console.ReadLine());//ReadInt();
            var singleLetStr = new List<string>();
            var dict = new Dictionary<List<char>, int>(new MyComparer());
            for (int i = 0; i < n; ++i)
            {
                var s = Console.ReadLine();
                var diffLetters = s.Distinct().ToList();
                diffLetters.Sort();
                if(diffLetters.Count() == 1)
                    singleLetStr.Add(s);
                else if (diffLetters.Count() == 2)
                {

                    if (dict.ContainsKey(diffLetters))
                    {
                        dict[diffLetters] += s.Length;
                    }
                    else
                    {
                        dict.Add(diffLetters,s.Length);
                    }
                }
            }
            foreach (var s in singleLetStr)
            {
                if (dict.Keys.Any(x => x.Contains(s.First())))
                {
                    var dictItems = dict.Where(x => x.Key.Contains(s.First())).ToList();
                    foreach (var keyValuePair in dictItems)
                    {
                        dict[keyValuePair.Key] += s.Length;
                    }
                }
                else
                {
                    var list = new List<char>() {s.First()};
                    if (dict.ContainsKey(list))
                    {
                        dict[list] += s.Length;
                    }
                    else
                    {
                        dict.Add(list, s.Length);
                    }
                }
            }
            var oneLetKeyDictItems = dict.Where(x => x.Key.Count == 1).ToList();
            for (int i=0;i<oneLetKeyDictItems.Count;++i)
            {
                for (int j = i + 1; j < oneLetKeyDictItems.Count; ++j)
                {
                    var list = new List<char> {oneLetKeyDictItems[i].Key[0], oneLetKeyDictItems[j].Key[0]};
                    list.Sort();
                    if(dict.ContainsKey(list))
                        continue;
                    dict.Add(list,oneLetKeyDictItems[i].Value+oneLetKeyDictItems[j].Value);
                }
            }
            var res = dict.Count == 0 ? 0 : dict.Values.Max();
            Console.WriteLine(res);
            //Console.ReadLine();
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.Dispose();
        }

        #region Helpers

        private static int ReadInt()
        {
            return int.Parse(textReader.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(textReader.ReadLine());
        }

        private static int[] ReadIntArray()
        {
            return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        #endregion

        public void Dispose()
        {
            textReader.Close();
            textWriter.Close();
        }
    }
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Codeforces
{
    class MyComparer:IEqualityComparer<List<char>>
    {
        public bool Equals(List<char> x, List<char> y)
        {
            if (x.Count == y.Count)
            {
                var res = true;
                for (int i = 0; i < x.Count; ++i)
                {
                    if (x[i] != y[i])
                    {
                        res = false;
                        break;
                    }
                }
                return res;
            }
            return false;
        }

        public int GetHashCode(List<char> obj)
        {
            return base.GetHashCode();
        }
    }
    class Program : IDisposable
    {
        private static TextReader textReader = new StreamReader(Console.OpenStandardInput());
        private static TextWriter textWriter = new StreamWriter(Console.OpenStandardOutput());

        void Solve()
        {
            var n = int.Parse(Console.ReadLine());//ReadInt();
            var singleLetStr = new List<string>();
            var dict = new Dictionary<List<char>, int>(new MyComparer());
            for (int i = 0; i < n; ++i)
            {
                var s = Console.ReadLine();
                var diffLetters = s.Distinct().ToList();
                diffLetters.Sort();
                if(diffLetters.Count() == 1)
                    singleLetStr.Add(s);
                else if (diffLetters.Count() == 2)
                {

                    if (dict.ContainsKey(diffLetters))
                    {
                        dict[diffLetters] += s.Length;
                    }
                    else
                    {
                        dict.Add(diffLetters,s.Length);
                    }
                }
            }
            foreach (var s in singleLetStr)
            {
                if (dict.Keys.Any(x => x.Contains(s.First())))
                {
                    var dictItems = dict.Where(x => x.Key.Contains(s.First())).ToList();
                    foreach (var keyValuePair in dictItems)
                    {
                        dict[keyValuePair.Key] += s.Length;
                    }
                }
                else
                {
                    dict.Add(new List<char>(){s.First()},s.Length);
                }
            }
            for (int i=0;i<singleLetStr.Count;++i)
            {
                for (int j = i + 1; j < singleLetStr.Count; ++j)
                {
                    dict.Add(new List<char>(){singleLetStr[i][0],singleLetStr[j][0]},singleLetStr[i].Length+singleLetStr[j].Length );
                }
            }
            var res = dict.Count == 0 ? 0 : dict.Values.Max();
            Console.WriteLine(res);
            //Console.ReadLine();
        }

        static void Main(string[] args)
        {
            var p = new Program();

            p.Solve();
            p.Dispose();
        }

        #region Helpers

        private static int ReadInt()
        {
            return int.Parse(textReader.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(textReader.ReadLine());
        }

        private static int[] ReadIntArray()
        {
            return textReader.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        #endregion

        public void Dispose()
        {
            textReader.Close();
            textWriter.Close();
        }
    }
}