Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area. 

Advertisers will put up the ad only if it is possible to place all three logos on the billboard so that they do not overlap and the billboard has no empty space left. When you put a logo on the billboard, you should rotate it so that the sides were parallel to the sides of the billboard.

Your task is to determine if it is possible to put the logos of all the three companies on some square billboard without breaking any of the described rules.

Input

The first line of the input contains six positive integers x1, y1, x2, y2, x3, y3 (1 ≤ x1, y1, x2, y2, x3, y3 ≤ 100), where xi and yi determine the length and width of the logo of the i-th company respectively.

Output

If it is impossible to place all the three logos on a square shield, print a single integer "-1" (without the quotes).

If it is possible, print in the first line the length of a side of square n, where you can place all the three logos. Each of the next n lines should contain n uppercase English letters "A", "B" or "C". The sets of the same letters should form solid rectangles, provided that:

  * the sizes of the rectangle composed from letters "A" should be equal to the sizes of the logo of the first company, 
  * the sizes of the rectangle composed from letters "B" should be equal to the sizes of the logo of the second company, 
  * the sizes of the rectangle composed from letters "C" should be equal to the sizes of the logo of the third company, 



Note that the logos of the companies can be rotated for printing on the billboard. The billboard mustn't have any empty space. If a square billboard can be filled with the logos in multiple ways, you are allowed to print any of them.

See the samples to better understand the statement.

Examples

Input

5 1 2 5 5 2


Output

5
AAAAA
BBBBB
BBBBB
CCCCC
CCCCC


Input

4 4 2 6 4 2


Output

6
BBBBBB
BBBBBB
AAAACC
AAAACC
AAAACC
AAAACC
import java.io.*;
import java.util.StringTokenizer;


public class MyMain {
    public static String filename = MyMain.class.getCanonicalName().toLowerCase();
    public static int read = 2; //0 - .in/.out; 1 - input.txt/output.txt; 2 - stdin/stdout

    public static void main(String[] argv) throws IOException {
        Task t;
        boolean home = argv.length > 0 && argv[0].equals("oleg");
        InputStream inputStream;
        OutputStream outputStream;
        if (home) {
            inputStream = new FileInputStream(filename + ".in");
            outputStream = new FileOutputStream(filename + ".out");
        } else {
            switch (MyMain.read) {
                case 0:
                    inputStream = new FileInputStream(filename + ".in");
                    outputStream = new FileOutputStream(filename + ".out");
                    break;
                case 1:
                    inputStream = new FileInputStream("input.txt");
                    outputStream = new FileOutputStream("output.txt");
                    break;
                default:
                    inputStream = System.in;
                    outputStream = System.out;
                    break;

            }

        }
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream, home);


        if (home)
            do {
                long time = System.currentTimeMillis();
                t = new Task();
                t.in = in;
                t.out = out;
                t.run();
                out.writeln();
                out.writeln("=====Time:" + (System.currentTimeMillis() - time));
                out.flush();
            } while (in.hasNext());
        else {
            t = new Task();
            t.in = in;
            t.out = out;
            t.run();
        }

        out.close();

    }

}

class Task {
    public OutputWriter out;
    public InputReader in;


    int get2(int index) {
        int a = 2*(index / 2) + (index+1)%2;
        return a;
    }

    void outlet(char let, int n, int h){
        for(int i =0;i<h;i++){
            for(int j =0;j<n;j++){
                out.write(let);
            }
            out.writeln();
        }

    }
    char getLetByAB(int a, int b){
        char[] arr4 =  {'A', 'B', 'C'};
        for (char i = 0; i < 6; i++) {
            if((arr[i]==a && arr[get2(i)]==b) || (arr[i]==b && arr[get2(i)]==a)){
                return arr4[(i/2)];
            }
        }
        return '-';
    }
    int[] arr;
    public void run() {
        arr = new int[6];
        int max = 0;
        for (int i = 0; i < 6; i++) {
            arr[i] = in.nextInt();
            if (arr[i] > arr[max])
                max = i;
        }
        int lon = max / 2;
        int max2 = get2(max);
        int n = arr[max];
        int b = arr[max] - arr[max2];
        if(arr[0]*arr[1]+arr[2]*arr[3]+arr[4]*arr[5]!=n*n)
        {
            out.write(-1);
            return;
        }
        int left = b;
        int count = 2;

        for (int i = 0; i < 6; i++) {
            //FC
            if(i/2!=lon){
                if(arr[i]==n){
                    count--;
                    left -= arr[get2(i)];
                }
            }
        }
        if(count==0 && left ==0){
            //FCout
            out.writeln(n);
            char curlet = 'A';
            for (int i = 0; i < 6; i++)
            {
                if(arr[i]==n){
                    outlet(curlet, n, arr[get2(i)]);
                    curlet++;
                }

            }
        }  else{
            left = n;
            count = 2;
            int troll=0;
            for (int i = 0; i < 6; i++) {
                if(i/2!=lon){
                    if(arr[i]==b){
                        count--;
                        left -= arr[get2(i)];
                        troll = arr[get2(i)];
                    }
                }
            }
            while (left<0){
                left+=b;
                count++;

            }
            if(count==0 && left ==0){
                out.writeln(n);
                outlet(getLetByAB(n, n-b), n, n - b);
                char trollC = '0';
                char trollB = '1';
                switch (getLetByAB(n, n-b)) {
                    case 'C':
                        trollC = 'B';
                        trollB = 'A';
                        break;
                    case 'B':
                        trollC = 'C';
                        trollB = 'A';
                        break;
                    case 'A':
                        trollC = 'C';
                        trollB = 'B';
                        break;
                }
                for(int i =0;i<b;i++){
                    for(int j =0;j<n;j++){
                        if(j<troll)
                        out.write(trollC);
                        else
                            out.write(trollB);
                    }
                    out.writeln();
                }
            } else {
                out.write(-1);
            }
        }

    }


}


/*
===Readers===
 */
class InputReader {

    BufferedReader reader;
    StringTokenizer tokenizer;
    String nextLine;


    public InputReader(InputStream stream) throws IOException {
        tokenizer = null;
        reader = new BufferedReader(new InputStreamReader(stream));
        nextLine = reader.readLine();
    }

    public boolean hasNext() {
        return tokenizer.hasMoreTokens() || (nextLine != null);
    }


    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(nextLine);
                nextLine = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }

        return tokenizer.nextToken();
    }

    public String nextLine() {


        String oldLine = nextLine;

        try {
            nextLine = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException();
        }

        tokenizer = new StringTokenizer("");
        return oldLine;
    }

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

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

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

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

        return res;
    }

}

class OutputWriter {

    PrintWriter out;


    boolean home;

    public OutputWriter(OutputStream stream, boolean _home) {
        out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(stream)));
        home = _home;
    }

    public void write(Object... o) {
        for (Object cur : o)
            out.print(cur);

    }

    public void debug(Object... o) {
        if (home) {

            out.print("==DEBUG:");
            for (Object cur : o)
                out.print(" " + cur);
            out.println();
        }
    }

    public void writeln(Object... o) {
        write(o);
        out.println();
    }

    public void flush() {
        out.flush();
    }

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

}

