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.*;

public class Main {

    static MyScanner in;
    static PrintWriter out;
    //static Timer t = new Timer();

    public static void main(String[] args) throws IOException {
        in = new MyScanner();
        out = new PrintWriter(System.out, true);

        Logo a = new Logo(in.nextInt(), in.nextInt(), 'A'), b = new Logo(in.nextInt(), in.nextInt(), 'B');
        Logo c = new Logo(in.nextInt(), in.nextInt(), 'C');

        pref(a, b, c);
        pref(a, b, c.rotate());
        pref(a, b.rotate(), c);
        pref(a.rotate(), b, c);
        pref(a, b.rotate(), c.rotate());
        pref(a.rotate(), b, c.rotate());
        pref(a.rotate(), b.rotate(), c);
        pref(a.rotate(), b.rotate(), c.rotate());

        out.println(-1);
    }

    static void pref(Logo a, Logo b, Logo c) {
        func(a, b, c);
        func(a, c, b);
        func(b, a, c);
        func(b, c, a);
        func(c, a, b);
        func(c, b, a);
    }

    static void func(Logo a, Logo b, Logo c) {
        func1(a, b, c);
        func2(a, b, c);
    }

    static void func1(Logo a, Logo b, Logo c) { //one on enother
        if (a.x != b.x || b.x != c.x || c.x != a.x)
            return;

        int size = a.x;

        if (a.y + b.y + c.y != size)
            return;

        char[][] matx = new char[size][size];
        paint(matx, a.ch, 0, 0, size, a.y);
        paint(matx, b.ch, 0, a.y, size, a.y + b.y);
        paint(matx, c.ch, 0, a.y + b.y, size, size);
        print(matx);
    }

    static void func2(Logo a, Logo b, Logo c) { //one top, 2 bottom
        int size = a.x;

        if (b.x + c.x != size)
            return;

        if (a.y + b.y != size || b.y != c.y)
            return;

        char[][] matx = new char[size][size];
        paint(matx, a.ch, 0, 0, size, a.y);
        paint(matx, b.ch, 0, a.y, b.x, size);
        paint(matx, c.ch, b.x, a.y, size, size);
        print(matx);
    }

    static void paint(char[][] matx, char ch, int x1, int y1, int x2, int y2) {
        for (int i = x1; i < x2; i++)
            for (int j = y1; j < y2; j++)
                matx[i][j] = ch;
    }

    static void print(char[][] matx) {
        out.println(matx.length);
        for (char[] s : matx) {
            for (char ch : s)
                out.print(ch);
            out.println();
        }

        System.exit(0);
    }

}

class Logo {

    int x, y;
    char ch;

    public Logo(int x, int y, char ch) {
        this.x = x;
        this.y = y;
        this.ch = ch;
    }

    Logo rotate() {
        return new Logo(y, x, ch);
    }
}

class MyScanner {

    private final BufferedReader br;
    private StringTokenizer st;
    private String last;

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

    public MyScanner(String path) throws IOException {
        br = new BufferedReader(new FileReader(new File(path)));
        //br = new BufferedReader(new InputStreamReader(new FileInputStream(
        //new File(path)), "cp1251"));
    }

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

    String nextLine() throws IOException {
        st = null;
        return (last == null) ? br.readLine() : last;
    }

    boolean hasNext() {
        if (st != null && st.hasMoreElements())
            return true;

        try {
            while (st == null || !st.hasMoreElements()) {
                last = br.readLine();
                st = new StringTokenizer(last);
            }
        } catch (Exception e) {
            return false;
        }

        return true;
    }

    String[] nextStrings(int n) throws IOException {
        String[] arr = new String[n];
        for (int i = 0; i < n; i++)
            arr[i] = next();
        return arr;
    }

    String[] nextLines(int n) throws IOException {
        String[] arr = new String[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextLine();
        return arr;
    }

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

    int[] nextInts(int n) throws IOException {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextInt();
        return arr;
    }

    Integer[] nextIntegers(int n) throws IOException {
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextInt();
        return arr;
    }

    int[][] next2Ints(int n, int m) throws IOException {
        int[][] arr = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextInt();
        return arr;
    }

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

    long[] nextLongs(int n) throws IOException {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
            arr[i] = nextLong();
        return arr;
    }

    long[][] next2Longs(int n, int m) throws IOException {
        long[][] arr = new long[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                arr[i][j] = nextLong();
        return arr;
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next().replace(',', '.'));
    }

    double[] nextDoubles(int size) throws IOException {
        double[] arr = new double[size];
        for (int i = 0; i < size; i++)
            arr[i] = nextDouble();
        return arr;
    }

    boolean nextBool() throws IOException {
        String s = next();
        if (s.equalsIgnoreCase("true") || s.equals("1"))
            return true;

        if (s.equalsIgnoreCase("false") || s.equals("0"))
            return false;

        throw new IOException("Boolean expected, String found!");
    }
}