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
"""
    Author - Satwik Tiwari .
    21th NOV , 2020  - Saturday
"""

#===============================================================================================
#importing some useful libraries.

from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from functools import cmp_to_key

# from itertools import *
from heapq import *
from math import gcd, factorial,floor,ceil,sqrt

from copy import deepcopy
from collections import deque


from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect

#==============================================================================================
#fast I/O region
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def testcase(t):
    for pp in range(t):
        solve(pp)
def google(p):
    print('Case #'+str(p)+': ',end='')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    y%=(p-1)  #not so sure about this. used when y>p-1. if p is prime.
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True
inf = pow(10,20)
mod = 10**9+7
#===============================================================================================
# code here ;))



def solve(case):
    x1,y1,x2,y2,x3,y3 = sep()


    arr = x1*y1 + x2*y2 + x3*y3
    for jj in range(8):
        # print(x1,x2,x3,y1,y2,y3,x1 == x2,x2 == x3,y1+y2+y2, x1)
        if(x1 == x2 and x2 == x3 and y1+y2+y3 == x1):
            print(x1)
            g = [[0 for _ in range(x1)] for __ in range(x1)]
            for i in range(x1):
                for j in range(y1):
                    g[i][j] = 'A'
            for i in range(x1):
                for j in range(y1,y1+y2):
                    g[i][j] = 'B'
            for i in range(x1):
                for j in range(y1+y2,y1+y2+y3):
                    g[i][j] = 'C'

            for i in range(x1):
                print(''.join(g[i]))
            return

        else:
            pass

        x1,y1 = y1,x1
        if(jj%2==1):
            x2,y2 = y2,x2
        if(jj%4==3):
            x3,y3 = y3,x3

    # print('==')
    # x1,y1 = y1,x1
    # x2,y2 = y2,x2
    # x3,y3 = y3,x3

    for jj in range(8):
        # print(x1,y1,x2,y2,x3,y3)
        n = [x1+x2,x1+x3,x2+x3]
        for i in range(len(n)):
            # print(arr,n[i]*n[i])
            if(arr != (n[i]*n[i])):
                continue
            if(i == 0 and y3!=max(y1,y2) - min(y1,y2)):
                continue
            if(i == 1 and y2!=max(y1,y3) - min(y1,y3)):
                continue
            if(i == 2 and y1!=max(y2,y3) - min(y2,y3)):
                continue

            # print(x1,x2,x3,y1,y2,y3,n[i],arr)
            g = [[0 for _ in range(n[i])] for __ in range(n[i])]
            if(i == 0 or i == 5):
                for j in range(x1):
                    for k in range(y1):
                        g[j][k] = 'A'
                for j in range(x1,x1+x2):
                    for k in range(y2):
                        g[j][k] = 'B'
                for j in range(n[i]):
                    for k in range(n[i]):
                        if(g[j][k] == 0):
                            g[j][k] = 'C'
                print(n[i])
                for ii in range(n[i]):
                    print(''.join(g[ii]))
                return
            if(i == 1 or i == 4):
                # print(x1,x2,x3,y1,y2,y3,n[i],i)
                for j in range(x1):
                    for k in range(y1):
                        g[j][k] = 'A'
                for j in range(x1,x1+x3):
                    for k in range(y3):
                        g[j][k] = 'C'
                for j in range(n[i]):
                    for k in range(n[i]):
                        if(g[j][k] == 0):
                            g[j][k] = 'B'
                print(n[i])
                for ii in range(n[i]):
                    print(''.join(g[ii]))
                return
            if(i == 2 or i==3):
                # print(x1,x2,x3,y1,y2,y3,n[i])
                for j in range(x2):
                    for k in range(y2):
                        g[j][k] = 'B'
                for j in range(x2,x3+x2):
                    for k in range(y3):
                        g[j][k] = 'C'
                for j in range(n[i]):
                    for k in range(n[i]):
                        if(g[j][k] == 0):
                            g[j][k] = 'A'
                print(n[i])
                for ii in range(n[i]):
                    print(''.join(g[ii]))
                return
        x1,y1 = y1,x1
        if(jj%2==1):
            x2,y2 = y2,x2
        if(jj%4==3):
            x3,y3 = y3,x3
    print(-1)

testcase(1)
# testcase(int(inp()))






