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.awt.Point;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import static java.lang.Math.*;
import java.util.Map;

/**
 *
 * @author Mojtaba
 */
public class Main {

    public static void main(String[] args) throws IOException {
        MyScanner in = new MyScanner(System.in);
        PrintWriter writer = new PrintWriter(new BufferedOutputStream(System.out));
        StringBuilder sb = new StringBuilder("");

        ArrayList<Rect> rect = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            int w = in.nextInt();
            int h = in.nextInt();
            char ch = 'A';
            if (i == 0) {
                ch = 'A';
            } else if (i == 1) {
                ch = 'B';
            } else {
                ch = 'C';
            }
            rect.add(new Rect(w, h, ch));
        }
        for (int i = 2; i >= 0; i--) {
            rect.add(rect.get(i).Rev());
        }
        boolean ok = false;
        search:
        {
            for (int i = 0; i < rect.size(); i++) {
                for (int j = 0; j < rect.size(); j++) {
                    if (rect.get(i).ch == rect.get(j).ch) {
                        continue;
                    }
                    for (int k = 0; k < rect.size(); k++) {
                        if (rect.get(i).ch == rect.get(k).ch || rect.get(j).ch == rect.get(k).ch) {
                            continue;
                        }
                        if (rect.get(j).w == rect.get(i).w + rect.get(k).w && rect.get(i).h == rect.get(k).h && rect.get(j).w == rect.get(k).h + rect.get(j).h) {
                            ok = true;
                            sb.append(rect.get(j).w).append("\n");
                            for (int ii = 0; ii < rect.get(j).h; ii++) {
                                StringBuilder builder = new StringBuilder();
                                for (int jj = 0; jj < rect.get(j).w; jj++) {
                                    builder.append(rect.get(j).ch);
                                }
                                sb.append(builder.toString().trim()).append("\n");
                            }
                            for (int ii = 0; ii < rect.get(i).h; ii++) {
                                StringBuilder builder = new StringBuilder();
                                for (int jj = 0; jj < rect.get(i).w; jj++) {
                                    builder.append(rect.get(i).ch);
                                }
                                for (int jj = 0; jj < rect.get(k).w; jj++) {
                                    builder.append(rect.get(k).ch);
                                }
                                sb.append(builder.toString().trim()).append("\n");
                            }
                            break search;
                        }
                        if (rect.get(i).w == rect.get(j).w && rect.get(j).w == rect.get(k).w) {
                            int temp1 = (rect.get(i).h + rect.get(j).h + rect.get(k).h);
                            if (temp1 != rect.get(i).w) {
                                continue;
                            }
                            sb.append(temp1).append("\n");
                            for (int ii = 0; ii < rect.get(i).h; ii++) {
                                StringBuilder builder = new StringBuilder();
                                for (int jj = 0; jj < rect.get(i).w; jj++) {
                                    builder.append(rect.get(i).ch);
                                }
                                sb.append(builder.toString().trim()).append("\n");
                            }
                            for (int ii = 0; ii < rect.get(j).h; ii++) {
                                StringBuilder builder = new StringBuilder();
                                for (int jj = 0; jj < rect.get(j).w; jj++) {
                                    builder.append(rect.get(j).ch);
                                }
                                sb.append(builder.toString().trim()).append("\n");
                            }
                            for (int ii = 0; ii < rect.get(k).h; ii++) {
                                StringBuilder builder = new StringBuilder();
                                for (int jj = 0; jj < rect.get(k).w; jj++) {
                                    builder.append(rect.get(k).ch);
                                }
                                sb.append(builder.toString().trim()).append("\n");
                            }
                            ok = true;
                            break search;
                        }
                    }
                }
            }
        }
        if (!ok) {
            sb.append("-1");
        }

        //System.out.println(sb.toString().trim());
        writer.println(sb.toString().trim());
        writer.flush();
        in.close();
    }

    static void sort(int[] a, int bp) {
        Random rand = new Random();
        for (int i = a.length - 1; i > 0; i--) {
            int index = rand.nextInt(i + 1);
            // Simple swap
            int temp = a[index];
            a[index] = a[i];
            a[i] = temp;
        }
        Arrays.sort(a);
    }
}

class Rect {

    int w, h;
    char ch;

    public Rect(int w, int h, char ch) {
        this.w = w;
        this.h = h;
        this.ch = ch;
    }

    public Rect Rev() {
        Rect rect = new Rect(h, w, ch);
        return rect;
    }
}

class MyScanner {

    BufferedReader reader;
    StringTokenizer tokenizer;

    public MyScanner(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
    }

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

    public int[] nextIntegerArray(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i] = nextInt();
        }
        return a;
    }

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

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

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

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

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

    public BigInteger nextBigInteger() throws IOException {
        return new BigInteger(next());
    }

    public BigInteger nextBigInteger(int radix) throws IOException {
        return new BigInteger(next(), radix);
    }

    public String next() throws IOException {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
            return this.next();
        }
        return tokenizer.nextToken();
    }

    public void close() throws IOException {
        this.reader.close();
    }
}