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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Nguyen Trung Hieu - vuondenthanhcong11@gmail.com
 */
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);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private boolean haveAnswer = false;
        private static final String colors = "ABC";

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Pair<Integer, Integer>[] billBoards = new Pair[3];
            for (int i = 0; i < 3; i++) {
                billBoards[i] = IOUtils.readIntPair(in);
            }

            int[] idx = ArrayUtils.createOrder(3);

            do {
                Pair<Integer, Integer>[] curBoard = new Pair[3];
                for (int i = 0; i < 3; i++) {
                    curBoard[i] = billBoards[idx[i]];
                }

                for (int mask = 0; mask < (1 << 3); mask++) {
                    Pair<Integer, Integer>[] checkBoard = new Pair[3];
                    for (int bit = 0; bit < 3; bit++) {
                        checkBoard[bit] = curBoard[bit];
                        if (BitUtils.isContain(mask, bit)) {
                            checkBoard[bit] = checkBoard[bit].swap();
                        }
                    }

                    fillBoard(checkBoard, out, idx);
                    if (haveAnswer) {
                        return;
                    }
                }
            } while (ArrayUtils.nextPermutation(idx));

            out.printLine(-1);
        }

        private void fillBoard(Pair<Integer, Integer>[] board, OutputWriter out, int[] idx) {
            if (board[0].second == board[1].second && board[1].second == board[2].second) {
                if (board[0].first + board[1].first + board[2].first == board[0].second) {
                    out.printLine(board[0].second);
                    for (int i = 0; i < board[0].first; i++) {
                        for (int j = 0; j < board[0].second; j++) {
                            out.print(colors.charAt(idx[0]));
                        }
                        out.printLine();
                    }
                    for (int i = 0; i < board[1].first; i++) {
                        for (int j = 0; j < board[1].second; j++) {
                            out.print(colors.charAt(idx[1]));
                        }
                        out.printLine();
                    }
                    for (int i = 0; i < board[2].first; i++) {
                        for (int j = 0; j < board[2].second; j++) {
                            out.print(colors.charAt(idx[2]));
                        }
                        out.printLine();
                    }

                    haveAnswer = true;
                }
            }

            if (board[0].first + board[2].first == board[0].second + board[1].second &&
                    board[2].second == board[0].first + board[2].first &&
                    board[0].first == board[1].first) {
                out.printLine(board[2].second);
                for (int i = 0; i < board[0].first; i++) {
                    for (int j = 0; j < board[0].second; j++) {
                        out.print(colors.charAt(idx[0]));
                    }
                    for (int j = 0; j < board[1].second; j++) {
                        out.print(colors.charAt(idx[1]));
                    }
                    out.printLine();
                }
                for (int i = 0; i < board[2].first; i++) {
                    for (int j = 0; j < board[2].second; j++) {
                        out.print(colors.charAt(idx[2]));
                    }
                    out.printLine();
                }

                haveAnswer = true;
            }
        }

    }

    static class BitUtils {
        public static boolean isContain(long mask, int bit) {
            return (mask & ((long) 1 << bit)) != 0;
        }

    }

    static class IntArray extends IntList {
        private final int[] array;

        public IntArray(int[] array) {
            this.array = array;
        }

        public IntArray(IntCollection collection) {
            array = new int[collection.size()];
            int i = 0;
            for (IntIterator iterator = collection.iterator(); iterator.isValid(); iterator.advance())
                array[i++] = iterator.value();
        }


        public int get(int index) {
            return array[index];
        }


        public void set(int index, int value) {
            array[index] = value;
        }


        public int size() {
            return array.length;
        }

    }

    static interface IntComparator {
        public static final IntComparator DEFAULT = new IntComparator() {
            public int compare(int first, int second) {
                if (first < second)
                    return -1;
                if (first > second)
                    return 1;
                return 0;
            }
        };

        public int compare(int first, int second);

    }

    static abstract class IntCollection {
        public abstract IntIterator iterator();

        public abstract int size();

    }

    static class IOUtils {
        public static Pair<Integer, Integer> readIntPair(InputReader in) {
            int first = in.readInt();
            int second = in.readInt();
            return new Pair<Integer, Integer>(first, second);
//      return Pair.makePair(first, second);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

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

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    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 printLine() {
            writer.println();
        }

        public void print(char i) {
            writer.print(i);
        }

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

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class ArrayUtils {
        public static int[] createOrder(int size) {
            int[] order = new int[size];
            for (int i = 0; i < size; i++)
                order[i] = i;
            return order;
        }

        public static boolean nextPermutation(int[] array) {
            return new IntArray(array).nextPermutation();
        }

    }

    static interface IntIterator {
        public int value();

        public void advance();

        public boolean isValid();

    }

    static class Pair<U, V> implements Comparable<Pair<U, V>> {
        public final U first;
        public final V second;

        public static <U, V> Pair<U, V> makePair(U first, V second) {
            return new Pair<U, V>(first, second);
        }

        public Pair(U first, V second) {
            this.first = first;
            this.second = second;
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            return !(first != null ? !first.equals(pair.first) : pair.first != null) && !(second != null ? !second.equals(pair.second) : pair.second != null);

        }


        public int hashCode() {
            int result = first != null ? first.hashCode() : 0;
            result = 31 * result + (second != null ? second.hashCode() : 0);
            return result;
        }

        public Pair<V, U> swap() {
            return makePair(second, first);
        }


        public String toString() {
            return "(" + first + "," + second + ")";
        }

        @SuppressWarnings({"unchecked"})
        public int compareTo(Pair<U, V> o) {
            int value = ((Comparable<U>) first).compareTo(o.first);
            if (value != 0)
                return value;
            return ((Comparable<V>) second).compareTo(o.second);
        }

    }

    static abstract class IntList extends IntCollection implements Comparable<IntList> {
        public abstract int get(int index);

        public abstract void set(int index, int value);


        public IntIterator iterator() {
            return new IntIterator() {
                private int size = size();
                private int index = 0;

                public int value() throws NoSuchElementException {
                    if (!isValid())
                        throw new NoSuchElementException();
                    return get(index);
                }

                public void advance() throws NoSuchElementException {
                    if (!isValid())
                        throw new NoSuchElementException();
                    index++;
                }

                public boolean isValid() {
                    return index < size;
                }
            };
        }

        public boolean nextPermutation() {
            return nextPermutation(IntComparator.DEFAULT);
        }

        private boolean nextPermutation(IntComparator comparator) {
            int size = size();
            int last = get(size - 1);
            for (int i = size - 2; i >= 0; i--) {
                int current = get(i);
                if (comparator.compare(last, current) > 0) {
                    for (int j = size - 1; j > i; j--) {
                        if (comparator.compare(get(j), current) > 0) {
                            swap(i, j);
                            subList(i + 1, size).inPlaceReverse();
                            return true;
                        }
                    }
                }
                last = current;
            }
            return false;
        }

        public void inPlaceReverse() {
            for (int i = 0, j = size() - 1; i < j; i++, j--)
                swap(i, j);
        }

        public IntList subList(final int from, final int to) {
            return new SubList(from, to);
        }

        private void swap(int first, int second) {
            if (first == second)
                return;
            int temp = get(first);
            set(first, get(second));
            set(second, temp);
        }

        public int hashCode() {
            int hashCode = 1;
            for (IntIterator i = iterator(); i.isValid(); i.advance())
                hashCode = 31 * hashCode + i.value();
            return hashCode;
        }


        public boolean equals(Object obj) {
            if (!(obj instanceof IntList))
                return false;
            IntList list = (IntList) obj;
            if (list.size() != size())
                return false;
            IntIterator i = iterator();
            IntIterator j = list.iterator();
            while (i.isValid()) {
                if (i.value() != j.value())
                    return false;
                i.advance();
                j.advance();
            }
            return true;
        }

        public int compareTo(IntList o) {
            IntIterator i = iterator();
            IntIterator j = o.iterator();
            while (true) {
                if (i.isValid()) {
                    if (j.isValid()) {
                        if (i.value() != j.value()) {
                            if (i.value() < j.value())
                                return -1;
                            else
                                return 1;
                        }
                    } else
                        return 1;
                } else {
                    if (j.isValid())
                        return -1;
                    else
                        return 0;
                }
                i.advance();
                j.advance();
            }
        }

        private class SubList extends IntList {
            private final int to;
            private final int from;
            private int size;

            public SubList(int from, int to) {
                this.to = to;
                this.from = from;
                size = to - from;
            }


            public int get(int index) {
                if (index < 0 || index >= size)
                    throw new IndexOutOfBoundsException();
                return IntList.this.get(index + from);
            }


            public void set(int index, int value) {
                if (index < 0 || index >= size)
                    throw new IndexOutOfBoundsException();
                IntList.this.set(index + from, value);
            }


            public int size() {
                return size;
            }

        }

    }
}
