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.BufferedReader;
import java.io.FileReader;
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.io.*;
public class codeforces 
{ 
   static class Student{
       int x,y,z;
        Student(int x,int y,int z){
            this.x=x;
            this.y=y;
            this.z=z;
        }
    }
    static int prime[];
    static void sieveOfEratosthenes(int n) 
    { 
        // Create a boolean array "prime[0..n]" and initialize 
        // all entries it as true. A value in prime[i] will 
        // finally be false if i is Not a prime, else true. 
        int pos=0;
        prime= new int[n+1]; 
        for(int p = 2; p*p <=n; p++) 
        { 
            // If prime[p] is not changed, then it is a prime 
            if(prime[p] == 0)
            { 
                // Update all multiples of p
                prime[p]=p;
                for(int i = p*p; i <= n; i += p)
                    if(prime[i]==0)
                    prime[i] = p; 
            } 
        } 
    }
static    class Sortbyroll implements Comparator<Student> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(Student c, Student b) 
    { 
        return c.x-b.x;
    } 
} 
static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
 
    static class Edge{
        int a,b;
        Edge(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
    static class Trie{
        HashMap<Character,Trie>map;
         int c;
        Trie(){
            map=new HashMap<>();
            //z=null;
            //o=null;
            c=0;
        }
    }
    //static long ans;
    static int parent[];
    static int rank[];
    static int b[][];
    static int bo[];
    static int ho[];
    static int seg[];
    //static int pos;
   // static long mod=1000000007;
    //static int dp[][];
    static HashMap<Integer,Integer>map;
    static PriorityQueue<Student>q=new PriorityQueue<>();
    //static Stack<Integer>st;
   // static ArrayList<Character>ans;
    static ArrayList<ArrayList<Integer>>adj;
    //static long ans;
    static Trie root;
    static long fac[];
    static int gw,gb;
    static long mod=(long)(1000000007);
    //static int ans;
    static void solve()throws IOException{
        FastReader sc=new FastReader();
        int x1,x2,x3,y1,y2,y3,pos=0,a1,a2,a3,b1,b2,b3,i,j,k;
        x1=sc.nextInt();
        y1=sc.nextInt();
        x2=sc.nextInt();
        y2=sc.nextInt();
        x3=sc.nextInt();
        y3=sc.nextInt();
        char ch[][]=new char[3][3];
        for(i=0;i<8;i++){
            if((int)(i&(int)(1<<0))!=0){
                a1=x1;
                b1=y1;
            }
            else{
                a1=y1;
                b1=x1;
            }
            if((int)(i&(int)(1<<1))!=0){
                a2=x2;
                b2=y2;
            }
            else{
                a2=y2;
                b2=x2;
            }
            if((int)(i&(int)(1<<2))!=0){
                a3=x3;
                b3=y3;
            }
            else{
                a3=y3;
                b3=x3;
            }
            if(a1==a2&&a2==a3&&b1+b2+b3==a1){
                ch=new char[a1][a1];
                for(j=0;j<b1;j++){
                    for(k=0;k<a1;k++)
                        ch[j][k]='A';
                }
                for(j=b1;j<b1+b2;j++){
                    for(k=0;k<a1;k++){
                        ch[j][k]='B';
                    }
                }
                for(j=b1+b2;j<a1;j++){
                    for(k=0;k<a1;k++)
                        ch[j][k]='C';
                }
                pos=1;
                break;
            }
            else if(a1+a2==a3&&b1==b2&&b1+b3==a3){
                pos=1;
                ch=new char[a3][a3];
                for(j=0;j<b1;j++){
                    for(k=0;k<a1;k++){
                        ch[j][k]='A';
                    }
                }
                for(j=0;j<b1;j++){
                    for(k=a1;k<a3;k++)
                        ch[j][k]='B';
                }
                for(j=b1;j<a3;j++){
                    for(k=0;k<a3;k++)
                        ch[j][k]='C';
                }
                break;
            }
            else if(a1+a3==a2&&b1==b3&&b1+b2==a2){
                pos=1;
                ch=new char[a2][a2];
                for(j=0;j<b1;j++){
                    for(k=0;k<a1;k++){
                        ch[j][k]='A';
                    }
                }
                for(j=0;j<b1;j++){
                    for(k=a1;k<a2;k++)
                        ch[j][k]='C';
                }
                for(j=b1;j<a2;j++){
                    for(k=0;k<a2;k++)
                        ch[j][k]='B';
                }
                break;
            }
            else if(a2+a3==a1&&b2==b3&&b2+b1==a1){
                pos=1;
                ch=new char[a1][a1];
                for(j=b2;j<a1;j++){
                    for(k=0;k<a1;k++){
                        ch[j][k]='A';
                    }
                }
                for(j=0;j<b2;j++){
                    for(k=0;k<a2;k++)
                        ch[j][k]='B';
                }
                for(j=0;j<b2;j++){
                    for(k=a2;k<a1;k++)
                        ch[j][k]='C';
                }
                break;
            }
            else if(a1+a2+a3==b1&&b1==b2&&b1==b3){
                pos=1;
                ch=new char[b1][b1];
                for(j=0;j<b1;j++){
                    for(k=0;k<a1;k++)
                        ch[j][k]='A';
                }
                for(j=0;j<b1;j++){
                    for(k=a1;k<a1+a2;k++)
                        ch[j][k]='B';
                }
                for(j=0;j<b1;j++){
                    for(k=a1+a2;k<b1;k++)
                        ch[j][k]='C';
                }
                break;
            }
        }
        if(pos==0)
            System.out.println(-1);
        else{
            System.out.println(ch[0].length);
            for(i=0;i<ch[0].length;i++)
                System.out.println(new String(ch[i]));
        }
    }
   static int tr(int i,int n,int dp[][],int a[],int h,int l,int r,int in){
        if(i>=n)
            return 0;
        if(dp[i][in]!=-1)
            return dp[i][in];
        int mod1,mod2,ans1=0,ans2=0;
        mod1=(a[i]+in)%h;
        if(mod1>=l&&mod1<=r)
            ans1=1+tr(i+1,n,dp,a,h,l,r,mod1);
        else
            ans1=tr(i+1,n,dp,a,h,l,r,mod1);
        mod2=(a[i]+in-1)%h;
        if(mod2>=l&&mod2<=r)
            ans2=1+tr(i+1,n,dp,a,h,l,r,mod2);
        else
            ans2=tr(i+1,n,dp,a,h,l,r,mod2);
        dp[i][in]=Math.max(ans1,ans2);
        return dp[i][in];
    }
    static long nCr(long n, long r, 
                                    long p) 
    { 
        return (fac[(int)n]* modInverse(fac[(int)r], p) 
                % p * modInverse(fac[(int)(n-r)], p) 
                                    % p) % p; 
    } 
    //static int prime[];
    //static int dp[];
    public static void main(String[] args){
        //long sum=0;
        try {
                codeforces.solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
    }
       static long modInverse(long n, long p) 
    { 
        return power(n, p-(long)2,p); 
    } 
 static long power(long x, long y, long p) 
{ 
    long res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y %(long)2!=0) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } 
    return res%p;
 }
    /*public static long power(long x,long a) {
		if(a==0) return 1;
		if(a%2==1)return (x*1L*power(x,a-1))%mod;
		return (power((int)((x*1L*x)%mod),a/2))%mod;
	}*/
   static int find(int x) 
    { 
        // Finds the representative of the set 
        // that x is an element of 
        while(parent[x]!=x) 
        { 
            // if x is not the parent of itself 
            // Then x is not the representative of 
            // his set,
            x=parent[x];
  
            // so we recursively call Find on its parent 
            // and move i's node directly under the 
            // representative of this set 
        } 
  
        return x; 
    }
    static void union(int x, int y) 
    { 
        // Find representatives of two sets 
        int xRoot = find(x), yRoot = find(y); 
  
        // Elements are in the same set, no need 
        // to unite anything. 
        if (xRoot == yRoot) 
            return; 
  
         // If x's rank is less than y's rank 
        if (rank[xRoot] < rank[yRoot]) 
  
            // Then move x under y  so that depth 
            // of tree remains less 
            parent[xRoot] = yRoot; 
  
        // Else if y's rank is less than x's rank 
        else if (rank[yRoot] < rank[xRoot]) 
  
            // Then move y under x so that depth of 
            // tree remains less 
            parent[yRoot] = xRoot; 
  
        else // if ranks are the same 
        { 
            // Then move y under x (doesn't matter 
            // which one goes where) 
            parent[yRoot] = xRoot; 
  
            // And increment the the result tree's 
            // rank by 1 
            rank[xRoot] = rank[xRoot] + 1; 
        } 
    } 
    static long gcd(long a, long b) 
    { 
        if (a == 0){ 
             //ans+=b;
            return b;
        }
        return gcd(b % a, a); 
    }
}