import java.io.*;
import java.util.*;

public class Codeforces {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer token;
        token = new StringTokenizer(br.readLine());
        int x1, x2, x3, y1, y2, y3;
        x1 = Integer.parseInt(token.nextToken());
        y1 = Integer.parseInt(token.nextToken());
        x2 = Integer.parseInt(token.nextToken());
        y2 = Integer.parseInt(token.nextToken());
        x3 = Integer.parseInt(token.nextToken());
        y3 = Integer.parseInt(token.nextToken());
        int area = x1 * y1 + x2 * y2 + x3 * y3;
        int[] A, B, C;
        A = new int[2];
        B = new int[2];
        C = new int[2];
        int s = (int) Math.sqrt(area);
        int h;
        if (s * s != area) {
            System.out.println(-1);
        } else {
            // first case they are all aligned
            // A: flag1 , B: flag2, C: flag3
            A[0] = x1;
            A[1] = y1;
            B[0] = x2;
            B[1] = y2;
            C[0] = x3;
            C[1] = y3;
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    for (int k = 0; k < 2; k++) {
                        if ((A[i] + B[j] + C[k]) == s && A[1 - i] == B[1 - j]
                                && B[1 - j] == C[1 - k] && B[1 - j] == s) {
                            // then ok, need to print
                            h = A[1 - i];
                            System.out.println(h);
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;

                        } else if (s == (B[j] + C[k]) && (B[1 - j] == C[1 - k]) &&
                                s == (A[1 - i] + B[1 - j]) && A[i] == s) // if A widthwise
                        {
                            System.out.println(A[i]);
                            for (int ii = 0; ii < A[1 - i]; i++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (s == (A[i] + C[k]) && (A[1 - i] == C[1 - k]) &&
                                s == (B[1 - j] + A[1 - i]) && B[j] == s) // if B
                        {
                            System.out.println(B[j]);
                            for (int ii = 0; ii < B[1 - j]; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                System.out.println();
                            }
                            h = A[1 - i];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (s == (B[j] + A[i]) && (B[1 - j] == A[1 - i]) &&
                                s == (C[1 - k] + B[1 - j]) && C[k] == s) // if C
                        {
                            System.out.println(C[k]);
                            for (int ii = 0; ii < C[1 - k]; ii++) {
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; i++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                            return;
                        }
                    }
                }
            }
            System.out.println(-1);
        }
    }
}


import java.io.*;
import java.util.*;

public class Codeforces {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer token;
        token = new StringTokenizer(br.readLine());
        int x1, x2, x3, y1, y2, y3;
        x1 = Integer.parseInt(token.nextToken());
        y1 = Integer.parseInt(token.nextToken());
        x2 = Integer.parseInt(token.nextToken());
        y2 = Integer.parseInt(token.nextToken());
        x3 = Integer.parseInt(token.nextToken());
        y3 = Integer.parseInt(token.nextToken());
        int area = x1 * y1 + x2 * y2 + x3 * y3;
        int[] A, B, C;
        A = new int[2];
        B = new int[2];
        C = new int[2];
        int s = (int) Math.sqrt(area);
        int h;
        if (s * s != area) {
            System.out.println(-1);
        } else {
            // first case they are all aligned
            // A: flag1 , B: flag2, C: flag3
            A[0] = x1;
            A[1] = y1;
            B[0] = x2;
            B[1] = y2;
            C[0] = x3;
            C[1] = y3;
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    for (int k = 0; k < 2; k++) {
                        if ((A[i] + B[j] + C[k]) == s && A[1 - i] == B[1 - j]
                                && B[1 - j] == C[1 - k] && B[1 - j] == s) {
                            // then ok, need to print
                            h = A[1 - i];
                            System.out.println(h);
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;

                        } else if (s == (B[j] + C[k]) && (B[1 - j] == C[1 - k]) &&
                                s == (A[1 - i] + B[1 - j]) && A[i] == s) // if A widthwise
                        {
                            System.out.println(A[i]);
                            for (int ii = 0; ii < A[1 - i]; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (s == (A[i] + C[k]) && (A[1 - i] == C[1 - k]) &&
                                s == (B[1 - j] + A[1 - i]) && B[j] == s) // if B
                        {
                            System.out.println(B[j]);
                            for (int ii = 0; ii < B[1 - j]; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                System.out.println();
                            }
                            h = A[1 - i];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (s == (B[j] + A[i]) && (B[1 - j] == A[1 - i]) &&
                                s == (C[1 - k] + B[1 - j]) && C[k] == s) // if C
                        {
                            System.out.println(C[k]);
                            for (int ii = 0; ii < C[1 - k]; ii++) {
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                            return;
                        }
                    }
                }
            }
            System.out.println(-1);
        }
    }
}


import java.io.*;
import java.util.*;

public class Codeforces {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer token;
        token = new StringTokenizer(br.readLine());
        int x1, x2, x3, y1, y2, y3;
        x1 = Integer.parseInt(token.nextToken());
        y1 = Integer.parseInt(token.nextToken());
        x2 = Integer.parseInt(token.nextToken());
        y2 = Integer.parseInt(token.nextToken());
        x3 = Integer.parseInt(token.nextToken());
        y3 = Integer.parseInt(token.nextToken());
        int area = x1 * y1 + x2 * y2 + x3 * y3;
        int[] A, B, C;
        A = new int[2];
        B = new int[2];
        C = new int[2];
        int s = (int) Math.sqrt(area);
        int h;
        if (s * s != area) {
            System.out.println(-1);
        } else {
            // first case they are all aligned
            // A: flag1 , B: flag2, C: flag3
            A[0] = x1;
            A[1] = y1;
            B[0] = x2;
            B[1] = y2;
            C[0] = x3;
            C[1] = y3;
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    for (int k = 0; k < 2; k++) {
                        if ((A[i] + B[j] + C[k]) == s && A[1 - i] == B[1 - j]
                                && B[1 - j] == C[1 - k] && B[1 - j] == s) {
                            // then ok, need to print
                            h = A[1 - i];
                            System.out.println(h);
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;

                        } else if (A[i] == (B[j] + C[k]) && (B[1 - j] == C[1 - k]) &&
                                (B[j] + C[k]) == (A[1 - i] + B[1 - j])) // if A widthwise
                        {
                            System.out.println(A[i]);
                            for (int ii = 0; ii < A[1 - i]; i++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (B[i] == (A[j] + C[k]) && (A[1 - j] == C[1 - k])
                                && (A[j] + C[k]) == (A[1 - i] + B[1 - j])) // if B
                        {
                            System.out.println(B[i]);
                            for (int ii = 0; ii < B[1 - j]; ii++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }
                                System.out.println();
                            }
                            h = A[1 - i];
                            for (int ii = 0; ii < h; ii++) {
                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }

                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            return;
                        } else if (C[i] == (B[j] + A[k]) && (B[1 - j] == A[1 - k])
                                && (B[j] + A[k]) == (C[1 - i] + B[1 - j])) // if C
                        {
                            System.out.println(C[i]);
                            for (int ii = 0; ii < C[1 - k]; ii++) {
                                for (int jj = 0; jj < C[k]; jj++) {
                                    System.out.print('C');
                                }
                                System.out.println();
                            }
                            h = B[1 - j];
                            for (int ii = 0; ii < h; i++) {
                                for (int jj = 0; jj < B[j]; jj++) {
                                    System.out.print('B');
                                }

                                for (int jj = 0; jj < A[i]; jj++) {
                                    System.out.print('A');
                                }
                                System.out.println();
                            }
                        }
                    }
                }
            }
            System.out.println(-1);
        }
    }
}


//package main;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	public static void main(String [] args) {
		Scanner in = new Scanner(System.in);
		List<Logo> logos = new LinkedList<>();
		int max = Integer.MIN_VALUE; int maxLogo = 0;
		char[] chars = {'A', 'B', 'C'};
		for (int i = 0; i < 3; i++) {
			Logo logo = new Logo();
			logo.c = chars[i];
			int one = in.nextInt();
			int two = in.nextInt();
			if (one > two) {
				logo.one = one;
				logo.two = two;
			} else {
				logo.two = one;
				logo.one = two;
			}
			if (logo.one > max) {
				maxLogo = i;
				max = logo.one;
			}
			logos.add(logo);
		}
		Logo maxL = logos.remove(maxLogo);
		int width  = maxL.one;
		int height = maxL.two;
		int rHeight = width - height; int rWidth = width;
		// We need to fill up rwidth * rheight
		char[][] m = new char[width][width];
		for (int i = 0; i < width; i++) {
			for (int j = 0; j < height; j++) {
				m[i][j] = maxL.c;
			}
		}
		Logo first = logos.remove(0);
		Logo second = logos.remove(0);
		// Try first horizontal
		rHeight -= first.one;
		rWidth -= first.two;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.two; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = rWidth; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.one; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.one; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		// Try first vertical
		rHeight = width - height; rWidth = width;
		rHeight -= first.two;
		rWidth -= first.one;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.one; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = rWidth; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.two; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.two; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		System.out.println(-1);
	}

	private static boolean dimensionMatch(Logo logo, int a, int b) {
		return a == logo.one && b == logo.two || a == logo.two && b == logo.one;
	}

	private static void printShit(char[][] c) {
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[0].length; j++) {
				System.out.print(c[i][j] + " ");;
			}
			System.out.println();
		}
	}
}

class Logo {
	int one;
	int two;
	char c;
}


//package main;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	public static void main(String [] args) {
		Scanner in = new Scanner(System.in);
		List<Logo> logos = new LinkedList<>();
		int max = Integer.MIN_VALUE; int maxLogo = 0;
		char[] chars = {'A', 'B', 'C'};
		for (int i = 0; i < 3; i++) {
			Logo logo = new Logo();
			logo.c = chars[i];
			int one = in.nextInt();
			int two = in.nextInt();
			if (one > two) {
				logo.one = one;
				logo.two = two;
			} else {
				logo.two = one;
				logo.one = two;
			}
			if (logo.one > max) {
				maxLogo = i;
				max = logo.one;
			}
			logos.add(logo);
		}
		Logo maxL = logos.remove(maxLogo);
		int width  = maxL.one;
		int height = maxL.two;
		int rHeight = width - height; int rWidth = width;
		// We need to fill up rwidth * rheight
		char[][] m = new char[width][width];
		for (int i = 0; i < width; i++) {
			for (int j = 0; j < height; j++) {
				m[i][j] = maxL.c;
			}
		}
		Logo first = logos.remove(0);
		Logo second = logos.remove(0);
		// Try first horizontal
		rHeight -= first.one;
		rWidth -= first.two;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.two; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = rWidth; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.one; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.one; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		// Try first vertical
		rHeight = width - height; rWidth = width;
		rHeight -= first.two;
		rWidth -= first.one;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.one; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = rWidth; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.two; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.two; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		System.out.println(-1);
	}

	private static boolean dimensionMatch(Logo logo, int a, int b) {
		return a == logo.one && b == logo.two || a == logo.two && b == logo.one;
	}

	private static void printShit(char[][] c) {
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[0].length; j++) {
				System.out.print(c[i][j]);;
			}
			System.out.println();
		}
	}
}

class Logo {
	int one;
	int two;
	char c;
}


//package main;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Solution {
	public static void main(String [] args) {
		Scanner in = new Scanner(System.in);
		List<Logo> logos = new LinkedList<>();
		int max = Integer.MIN_VALUE; int maxLogo = 0;
		char[] chars = {'A', 'B', 'C'};
		for (int i = 0; i < 3; i++) {
			Logo logo = new Logo();
			logo.c = chars[i];
			int one = in.nextInt();
			int two = in.nextInt();
			if (one > two) {
				logo.one = one;
				logo.two = two;
			} else {
				logo.two = one;
				logo.one = two;
			}
			if (logo.one > max) {
				maxLogo = i;
				max = logo.one;
			}
			logos.add(logo);
		}
		Logo maxL = logos.remove(maxLogo);
		int width  = maxL.one;
		int height = maxL.two;
		int rHeight = width - height; int rWidth = width;
		// We need to fill up rwidth * rheight
		char[][] m = new char[width][width];
		for (int i = 0; i < width; i++) {
			for (int j = 0; j < height; j++) {
				m[i][j] = maxL.c;
			}
		}
		Logo first = logos.remove(0);
		Logo second = logos.remove(0);
		// Try first horizontal
		rHeight -= first.one;
		rWidth -= first.two;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.two; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = first.two; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.one; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.one; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		// Try first vertical
		rHeight = width - height; rWidth = width;
		rHeight -= first.two;
		rWidth -= first.one;
		if (rHeight == 0) {
			int h = width - height;
			if (dimensionMatch(second, h, rWidth)) {
				System.out.println(width);
				for (int i = 0; i < first.one; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = first.one; i < width; i++) {
					for (int j = height; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		if (rWidth == 0) {
			if (dimensionMatch(second, width, rHeight)) {
				System.out.println(width);
				for (int i = 0; i < width; i++) {
					for (int j = height; j < height + first.two; j++) {
						m[i][j] = first.c;
					}
				}
				for (int i = 0; i < width; i++) {
					for (int j = height + first.two; j < width; j++) {
						m[i][j] = second.c;
					}
				}
				printShit(m);
			} else {
				System.out.println(-1);
			}
			return;
		}
		System.out.println(-1);
	}

	private static boolean dimensionMatch(Logo logo, int a, int b) {
		return a == logo.one && b == logo.two || a == logo.two && b == logo.one;
	}

	private static void printShit(char[][] c) {
		for (int i = 0; i < c.length; i++) {
			for (int j = 0; j < c[0].length; j++) {
				System.out.print(c[i][j]);;
			}
			System.out.println();
		}
	}
}

class Logo {
	int one;
	int two;
	char c;
}


import java.io.*;
import java.util.StringTokenizer;

public class MyMain {
    public static String filename = MyMain.class.getCanonicalName().toLowerCase();
    public static int read = 2; //0 - .in/.out; 1 - input.txt/output.txt; 2 - stdin/stdout

    public static void main(String[] argv) throws IOException {
        Task t;
        boolean home = argv.length > 0 && argv[0].equals("oleg");
        InputStream inputStream;
        OutputStream outputStream;
        if (home) {
            inputStream = new FileInputStream(filename + ".in");
            outputStream = new FileOutputStream(filename + ".out");
        } else {
            switch (MyMain.read) {
                case 0:
                    inputStream = new FileInputStream(filename + ".in");
                    outputStream = new FileOutputStream(filename + ".out");
                    break;
                case 1:
                    inputStream = new FileInputStream("input.txt");
                    outputStream = new FileOutputStream("output.txt");
                    break;
                default:
                    inputStream = System.in;
                    outputStream = System.out;
                    break;

            }

        }
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream, home);

        if (home)
            do {
                long time = System.currentTimeMillis();
                t = new Task();
                t.in = in;
                t.out = out;
                t.run();
                out.writeln();
                out.writeln("=====Time:" + (System.currentTimeMillis() - time));
                out.flush();
            } while (in.hasNext());
        else {
            t = new Task();
            t.in = in;
            t.out = out;
            t.run();
        }

        out.close();

    }

}

class Task {
    public OutputWriter out;
    public InputReader in;

    int get2(int index) {
        int a = 2*(index / 2) + (index+1)%2;
        return a;
    }

    void outlet(char let, int n, int h){
        for(int i =0;i<h;i++){
            for(int j =0;j<n;j++){
                out.write(let);
            }
            out.writeln();
        }

    }
    char getLetByAB(int a, int b){
        char[] arr4 =  {'A', 'B', 'C'};
        for (char i = 0; i < 6; i++) {
            if((arr[i]==a && arr[get2(i)]==b) || (arr[i]==b && arr[get2(i)]==a)){
                return arr4[(i/2)];
            }
        }
        return '-';
    }
    int[] arr;
    public void run() {
        arr = new int[6];
        int max = 0;
        for (int i = 0; i < 6; i++) {
            arr[i] = in.nextInt();
            if (arr[i] > arr[max])
                max = i;
        }
        int lon = max / 2;
        int max2 = get2(max);
        int n = arr[max];
        int b = arr[max] - arr[max2];
        if(arr[0]*arr[1]+arr[2]*arr[3]+arr[4]*arr[5]!=n*n)
        {
            out.write(-1);
            return;
        }
        int left = b;
        int count = 2;

        for (int i = 0; i < 6; i++) {
            //FC
            if(i/2!=lon){
                if(arr[i]==n){
                    count--;
                    left -= arr[get2(i)];
                }
            }
        }
        if(count==0 && left ==0){
            //FCout
            out.writeln(n);
            char curlet = 'A';
            for (int i = 0; i < 6; i++)
            {
                if(arr[i]==n){
                    outlet(curlet, n, arr[get2(i)]);
                    curlet++;
                }

            }
        }  else{
            left = n;
            count = 2;
            int troll=0;
            for (int i = 0; i < 6; i++) {
                if(i/2!=lon){
                    if(arr[i]==b){
                        count--;
                        left -= arr[get2(i)];
                        troll = arr[get2(i)];
                    }
                }
            }
            while (left<0){
                left+=b;
                count++;

            }
            if(count==0 && left ==0){
                out.writeln(n);
                outlet(getLetByAB(n, n-b), n, n - b);
                char trollC = '0';
                char trollB = '1';
                switch (getLetByAB(n, n-b)) {
                    case 'C':
                        trollC = 'B';
                        trollB = 'A';
                        break;
                    case 'B':
                        trollC = 'C';
                        trollB = 'A';
                        break;
                    case 'A':
                        trollC = 'C';
                        trollB = 'B';
                        break;
                }
                for(int i =0;i<b;i++){
                    for(int j =0;j<n;j++){
                        if(j<troll)
                        out.write(trollC);
                        else
                            out.write(trollB);
                    }
                    out.writeln();
                }
            } else {
                out.write(-1);
            }
        }

    }

}

/*
===Readers===
 */
class InputReader {

    BufferedReader reader;
    StringTokenizer tokenizer;
    String nextLine;

    public InputReader(InputStream stream) throws IOException {
        tokenizer = null;
        reader = new BufferedReader(new InputStreamReader(stream));
        nextLine = reader.readLine();
    }

    public boolean hasNext() {
        return tokenizer.hasMoreTokens() || (nextLine != null);
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {

                tokenizer = new StringTokenizer(nextLine);
                nextLine = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }

        return tokenizer.nextToken();
    }

    public String nextLine() {

        String oldLine = nextLine;

        try {
            nextLine = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException();
        }

        tokenizer = new StringTokenizer("");
        return oldLine;
    }

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

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

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

    public int[] nextIntArray(int n) {
        int[] res = new int[n];
        for (int i = 0; i < n; i++)
            res[i] = nextInt();

        return res;
    }

}

class OutputWriter {

    PrintWriter out;

    boolean home;

    public OutputWriter(OutputStream stream, boolean _home) {
        out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(stream)));
        home = _home;
    }

    public void write(Object... o) {
        for (Object cur : o)
            out.print(cur);

    }

    public void debug(Object... o) {
        if (home) {

            out.print("==DEBUG:");
            for (Object cur : o)
                out.print(" " + cur);
            out.println();
        }
    }

    public void writeln(Object... o) {
        write(o);
        out.println();
    }

    public void flush() {
        out.flush();
    }

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

}


import java.util.*;
import java.io.*;

public class D {

    public static void main(String[] args) throws Exception {
        InputReader in = new InputReader();

        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        int[][] sizes = new int[3][2];

        int longest = -1;
        int longestIndx = -1;

        for (int i = 0; i < 3; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a > b) {
                sizes[i][0] = a;
                sizes[i][1] = b;
                if (a > longest) {
                    longest = a;
                    longestIndx = i;
                }
            } else {
                sizes[i][0] = b;
                sizes[i][1] = a;
                if (b > longest) {
                    longest = b;
                    longestIndx = i;
                }
            }
        }

        int longestRectShorter = sizes[longestIndx][1];

        if (sizes[0][0] == sizes[1][0] && sizes[0][0] == sizes[2][0] && sizes[0][1] + sizes[1][1] + sizes[2][1] == sizes[0][0]) {
                // draw triline square
            out.println(longest);
            for (int k = 0; k < sizes[0][1]; k++) {
                for (int l = 0; l < longest; l++) {
                    out.write('A');
                }
                out.write('\n');
            }

            for (int k = 0; k < sizes[1][1]; k++) {
                for (int l = 0; l < longest; l++) {
                    out.write('B');
                }
                out.write('\n');
            }

            for (int k = 0; k < sizes[2][1]; k++) {
                for (int l = 0; l < longest; l++) {
                    out.write('C');
                }
                out.write('\n');
            }

            out.close();
            System.exit(0);

        } else {

            for (int i = 0; i < 3; i++) {
                if (i == longestIndx)
                    continue;

                for (int j = i + 1; j < 3; j++) {
                    if (j == longestIndx)
                        continue;

                    int same = 0, a = 0, b = 0;

                    if (sizes[i][0] == sizes[j][0] && sizes[i][0] + longestRectShorter == longest && sizes[i][1] + sizes[j][1] == longest) {
                        same = sizes[i][0];
                        a = sizes[i][1];
                        b = sizes[j][1];
                    } else if (sizes[i][0] == sizes[j][1] && sizes[i][0] + longestRectShorter == longest && sizes[i][1] + sizes[j][0] == longest) {
                        same = sizes[i][0];
                        a = sizes[i][1];
                        b = sizes[j][0];
                    } else if (sizes[i][1] == sizes[j][0] && sizes[i][1] + longestRectShorter == longest && sizes[i][0] + sizes[j][1] == longest) {
                        same = sizes[i][1];
                        a = sizes[i][0];
                        b = sizes[j][1];
                    } else if (sizes[i][1] == sizes[j][1] && sizes[i][1] + longestRectShorter == longest && sizes[i][0] + sizes[j][0] == longest) {
                        same = sizes[i][1];
                        a = sizes[i][0];
                        b = sizes[j][0];
                    } else
                        continue;

                    out.println(longest);

                    for (int k = 0; k < longestRectShorter; k++) {
                        for (int l = 0; l < longest; l++) {
                            out.write((char)('A' + longestIndx));
                        }
                        out.write('\n');
                    }

                    for (int k = 0; k < same; k++) {
                        for (int l = 0; l < a; l++) {
                            out.write((char)('A' + i));
                        }
                        for (int l = 0; l < b; l++) {
                            out.write((char)('A' + j));
                        }
                        out.write('\n');
                    }

                    out.close();
                    System.exit(0);

                }
            }
            out.println(-1);
            out.close();
            System.exit(0);
        }
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[2048];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader() {
        this.stream = System.in;
    }

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

    public InputReader(SpaceCharFilter filter) {
        this.stream = System.in;
        this.filter = filter;
    }

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

    public int read() {
        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 char nextChar() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public int nextDigit() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return c - '0';
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        boolean negative = false;
        if (c == '-') {
            negative = true;
            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 negative ? -res : res;
    }

    public int nextUnsignedInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res;
    }

    public final long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        boolean negative = false;
        if (c == '-') {
            negative = true;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return negative ? -res : res;
    }

    public final long nextUnsignedLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        long sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!(c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 || c == '.'));

        if (c != '.') {
            return res * sgn;
        }
        c = read();

        long aft = 0;
        int len = 1;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            aft *= 10;
            len *= 10;
            aft += c - '0';
            c = read();
        } while (!isSpaceChar(c));

        return res * sgn + aft / (1.0 * len);
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public boolean isEndChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public char[] nextChars() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));

        char[] chars = new char[res.length()];
        res.getChars(0, chars.length, chars, 0);
        return chars;
    }

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


import java.util.*;

public class D {
    public static void print (int i, int j, char c){
        for (int k = 0; k < i; k++) {
            for (int l = 0; l < j; l++) {
                System.out.print(c);
            }
            System.out.println();
        }
    }

    public static void p (int h, int l1, int l2, char c1, char c2){
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < l1; j++) {
                System.out.print(c1);
            }
            for (int j = 0; j < l2; j++) {
                System.out.print(c2);
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int tmp;

        int x1 = in.nextInt(), y1 = in.nextInt();
        int x2 = in.nextInt(), y2 = in.nextInt();
        int x3 = in.nextInt(), y3 = in.nextInt();

        if (x1 > y1){
            tmp = x1;
            x1 = y1;
            y1 = tmp;
        }

        if (x2 > y2){
            tmp = x2;
            x2 = y2;
            y2 = tmp;
        }

        if (x3 > y3){
            tmp = x3;
            x3 = y3;
            y3 = tmp;
        }

        if ((y1 == y2) && (y2 == y3) && (x1 + x2 + x3 == y3)){
            System.out.println(y1);
            print(x1, y1, 'A');
            print(x2, y2, 'B');
            print(x3, y3, 'C');
        }
        else {
            int max = y1;
            int min = x1;
            char c1 = 'A';
            char c2 = 'B';
            char c3 = 'C';
                int nx1 = x2;
                int ny1 = y2;
               int nx2 = x3;
            int ny2 = y3;

            if (max < y2) {
                 c1 = 'B';
                c2 = 'A';
                c3 = 'C';
                max = y2;
                 min = x2;
                 nx1 = x1;
                 ny1 = y1;
                 nx2 = x3;
                 ny2 = y3;
            }

            if (max < y3) {
                c1 = 'C';
                c2 = 'A';
                c3 = 'B';
                 min = x3;
                max = y3;
                nx1 = x1;
                ny1 = y1;
                nx2 = x2;
                ny2 = y2;
            }

        if (nx1 + nx2 == max && ny1 == ny2 && ny1 + min == max){
            System.out.println(max);
                print(min,max,c1);
                p(ny1, nx1, nx2, c2, c3);
        }
            else
            System.out.println(-1);

        }
    }
}


import java.util.*;

public class D {
    public static void print (int i, int j, char c){
        for (int k = 0; k < i; k++) {
            for (int l = 0; l < j; l++) {
                System.out.print(c);
            }
            System.out.println();
        }
    }

    public static void p (int h, int l1, int l2, char c1, char c2){
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < l1; j++) {
                System.out.print(c1);
            }
            for (int j = 0; j < l2; j++) {
                System.out.print(c2);
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int tmp;

        int x1 = in.nextInt(), y1 = in.nextInt();
        int x2 = in.nextInt(), y2 = in.nextInt();
        int x3 = in.nextInt(), y3 = in.nextInt();

        if (x1 > y1){
            tmp = x1;
            x1 = y1;
            y1 = tmp;
        }

        if (x2 > y2){
            tmp = x2;
            x2 = y2;
            y2 = tmp;
        }

        if (x3 > y3){
            tmp = x3;
            x3 = y3;
            y3 = tmp;
        }

        if ((y1 == y2) && (y2 == y3) && (x1 + x2 + x3 == y3)){
            print(x1, y1, 'A');
            print(x2, y2, 'B');
            print(x3, y3, 'C');
        }
        else {
            int max = y1;
            int min = x1;
            char c1 = 'A';
            char c2 = 'B';
            char c3 = 'C';
                int nx1 = x2;
                int ny1 = y2;
               int nx2 = x3;
            int ny2 = y3;

            if (max < y2) {
                 c1 = 'B';
                c2 = 'A';
                c3 = 'C';
                max = y2;
                 min = x2;
                 nx1 = x1;
                 ny1 = y1;
                 nx2 = x3;
                 ny2 = y3;
            }

            if (max < y3) {
                c1 = 'C';
                c2 = 'A';
                c3 = 'B';
                 min = x3;
                max = y3;
                nx1 = x1;
                ny1 = y1;
                nx2 = x2;
                ny2 = y2;
            }

        if (nx1 + nx2 == max && ny1 == ny2 && ny1 + min == max){
                print(min,max,c1);
                p(ny1, nx1, nx2, c2, c3);
        }
            else
            System.out.println(-1);

        }
    }
}


import java.util.*;

public class D {
    public static void print (int i, int j, char c){
        for (int k = 0; k < i; k++) {
            for (int l = 0; l < j; l++) {
                System.out.print(c);
            }
            System.out.println();
        }
    }

    public static void p (int h, int l1, int l2, char c1, char c2){
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < l1; j++) {
                System.out.print(c1);
            }
            for (int j = 0; j < l2; j++) {
                System.out.print(c2);
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int tmp;

        int x1 = in.nextInt(), y1 = in.nextInt();
        int x2 = in.nextInt(), y2 = in.nextInt();
        int x3 = in.nextInt(), y3 = in.nextInt();

        if (x1 > y1){
            tmp = x1;
            x1 = y1;
            y1 = tmp;
        }

        if (x2 > y2){
            tmp = x2;
            x2 = y2;
            y2 = tmp;
        }

        if (x3 > y3){
            tmp = x3;
            x3 = y3;
            y3 = tmp;
        }

        if ((y1 == y2) && (y2 == y3) && (x1 + x2 + x3 == y3)){
            System.out.println(y1);
            print(x1, y1, 'A');
            print(x2, y2, 'B');
            print(x3, y3, 'C');
        }
        else {
            int max = y1;
            int min = x1;
            char c1 = 'A';
            char c2 = 'B';
            char c3 = 'C';
                int nx1 = x2;
                int ny1 = y2;
               int nx2 = x3;
            int ny2 = y3;

            if (max < y2) {
                 c1 = 'B';
                c2 = 'A';
                c3 = 'C';
                max = y2;
                 min = x2;
                 nx1 = x1;
                 ny1 = y1;
                 nx2 = x3;
                 ny2 = y3;
            }

            if (max < y3) {
                c1 = 'C';
                c2 = 'A';
                c3 = 'B';
                 min = x3;
                max = y3;
                nx1 = x1;
                ny1 = y1;
                nx2 = x2;
                ny2 = y2;
            }

        if (nx1 + nx2 == max && ny1 == ny2 && ny1 + min == max){
            System.out.println(max);
                print(min,max,c1);
                p(ny1, nx1, nx2, c2, c3);
        }
        else
            if (ny1 + ny2 == max && nx1 == nx2 && nx1 + min == max){
                System.out.println(max);
                print(min,max,c1);
                p(nx1, ny1, ny2, c2, c3);
            }
            else
            if (nx2 + ny1 == max && nx1 == ny2 && nx1 + min == max){
                System.out.println(max);
                print(min,max,c1);
                p(nx1, ny1, nx2, c2, c3);
            }
            else
            if (nx1 + ny2 == max && nx2 == ny1 && nx2 + min == max){
                System.out.println(max);
                print(min,max,c1);
                p(nx2, nx1, ny2, c2, c3);
            }
            else
            System.out.println(-1);

        }
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else if (true){
			int t = a.get(0)[0];
			a.get(0)[0] = a.get(0)[1];
			a.get(0)[1] = t;
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
				if ((a.get(0)[1]+a.get(1)[1])==h){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) maxil);
						}
						System.out.println();
					}
					System.out.println();
					for (int i = 0; i<a.get(0)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						System.out.println();
					}
					for (int i = 0; i<a.get(1)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
				}
			} else
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
				if ((a.get(0)[1]+a.get(1)[1])==w){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (maxil));
						}
						System.out.println();
					}
					for (int i = 0; i<h; i++){
						for (int j = 0; j<a.get(0)[1]; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						for (int j = 0; j<a.get(1)[1]; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
					return;
				}
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else System.out.println(-1);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else System.out.println(-1);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else if (true){
			int t = a.get(0)[0];
			a.get(0)[0] = a.get(0)[1];
			a.get(0)[1] = t;
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
				if ((a.get(0)[1]+a.get(1)[1])==h){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) maxil);
						}
						System.out.println();
					}
					System.out.println();
					for (int i = 0; i<a.get(0)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						System.out.println();
					}
					for (int i = 0; i<a.get(1)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
				}
			} else
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
				if ((a.get(0)[1]+a.get(1)[1])==w){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (maxil));
						}
						System.out.println();
					}
					for (int i = 0; i<h; i++){
						for (int j = 0; j<a.get(0)[1]; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						for (int j = 0; j<a.get(1)[1]; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
					return;
				}
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		System.out.println(-1);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		else if (true){
			int t = a.get(0)[0];
			a.get(0)[0] = a.get(0)[1];
			a.get(0)[1] = t;
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
				if ((a.get(0)[1]+a.get(1)[1])==h){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) maxil);
						}
						System.out.println();
					}
					System.out.println();
					for (int i = 0; i<a.get(0)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						System.out.println();
					}
					for (int i = 0; i<a.get(1)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
				}
			} else
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
				if ((a.get(0)[1]+a.get(1)[1])==w){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (maxil));
						}
						System.out.println();
					}
					for (int i = 0; i<h; i++){
						for (int j = 0; j<a.get(0)[1]; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						for (int j = 0; j<a.get(1)[1]; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
					return;
				}
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else System.out.println(-1);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		else if (true){
			int t = a.get(0)[0];
			a.get(0)[0] = a.get(0)[1];
			a.get(0)[1] = t;
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
				if ((a.get(0)[1]+a.get(1)[1])==h){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) maxil);
						}
						System.out.println();
					}
					System.out.println();
					for (int i = 0; i<a.get(0)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						System.out.println();
					}
					for (int i = 0; i<a.get(1)[1]; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
				}
			} else
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
				if ((a.get(0)[1]+a.get(1)[1])==w){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (maxil));
						}
						System.out.println();
					}
					for (int i = 0; i<h; i++){
						for (int j = 0; j<a.get(0)[1]; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						for (int j = 0; j<a.get(1)[1]; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
					return;
				}
			}
		}
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==w)){
			if ((a.get(0)[0]+a.get(1)[0])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[0]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[1]==a.get(1)[1])&&(a.get(0)[1]==h)){
			if ((a.get(0)[0]+a.get(1)[0])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[0]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[0]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
				return;
			}
		}
		System.out.println(-1);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else {
			int t = a.get(0)[0];
			a.get(0)[0] = a.get(0)[1];
			a.get(0)[1] = t;
			if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
				if ((a.get(0)[1]+a.get(1)[1])==w){
					System.out.println(w);
					for (int i = 0; i<w-h; i++){
						for (int j = 0; j<w; j++){
							System.out.print((char) (maxil));
						}
						System.out.println();
					}
					for (int i = 0; i<h; i++){
						for (int j = 0; j<a.get(0)[1]; j++){
							System.out.print((char) (a.get(0)[2].intValue()));
						}
						for (int j = 0; j<a.get(1)[1]; j++){
							System.out.print((char) (a.get(1)[2].intValue()));
						}
						System.out.println();
					}
				}
			}
		}
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class codeforcesD {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		ArrayList<Integer[]> a = new ArrayList<Integer[]>();
		for (int i = 0; i<3; i++){
			int w = in.nextInt();
			int h = in.nextInt();
			Integer[] wh = {w, h, 65+i};
			a.add(wh);
		}
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]<a.get(i)[1]){
				int t = a.get(i)[0];
				a.get(i)[0] = a.get(i)[1];
				a.get(i)[1] = t;
			}
		}
		int max = -1;
		int maxi = -1;
		for (int i = 0; i<3; i++){
			if (a.get(i)[0]>max){
				max = a.get(i)[0];
				maxi = i;
			}
		}
		int w = max;
		int h = max-a.get(maxi)[1];
		int maxil = -1;
		a.remove(maxi);
		switch (maxi){
		case 0:{
			maxil = 65;
			break;
		}
		case 1: {
			maxil = 66;
			break;
		}
		case 2:{
			maxil = 67;
			break;
		}
		}
		int[][] ans = new int[w][w];
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==w)){
			if ((a.get(0)[1]+a.get(1)[1])==h){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) maxil);
					}
					System.out.println();
				}
				System.out.println();
				for (int i = 0; i<a.get(0)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					System.out.println();
				}
				for (int i = 0; i<a.get(1)[1]; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else
		if ((a.get(0)[0]==a.get(1)[0])&&(a.get(0)[0]==h)){
			if ((a.get(0)[1]+a.get(1)[1])==w){
				System.out.println(w);
				for (int i = 0; i<w-h; i++){
					for (int j = 0; j<w; j++){
						System.out.print((char) (maxil));
					}
					System.out.println();
				}
				for (int i = 0; i<h; i++){
					for (int j = 0; j<a.get(0)[1]; j++){
						System.out.print((char) (a.get(0)[2].intValue()));
					}
					for (int j = 0; j<a.get(1)[1]; j++){
						System.out.print((char) (a.get(1)[2].intValue()));
					}
					System.out.println();
				}
			}
		} else System.out.println(-1);
	}
}


import java.util.Scanner;

public class Main_Round322Div2_D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] x = new int[3];
		int[] y = new int[3];
		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}

		char[] c = {'A', 'B', 'C'};
		char[][] ret;

		for (int i = 0; i < 8; i++) {
			if (i == 4) {
				int tmp = x[0];
				x[0] = y[0];
				y[0] = tmp;
			}
			if (i % 2 == 0) {
				int tmp = x[1];
				x[1] = y[1];
				y[1] = tmp;
			}
			int tmp = x[2];
			x[2] = y[2];
			y[2] = tmp;

//			System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

			if ((ret = isType1(x, y, c)) != null) {
				prRet(ret);

				sc.close();
				return;
			}
		}

		for (int j = 0; j < 3; j++) {
			char ctmp = c[0];
			c[0] = c[1];
			c[1] = c[2];
			c[2] = ctmp;
			int[] itmp = new int[2];
			itmp[0] = x[0];
			itmp[1] = y[0];
			x[0] = x[1];
			y[0] = y[1];
			x[1] = x[2];
			y[1] = y[2];
			x[2] = itmp[0];
			y[2] = itmp[1];

			for (int i = 0; i < 8; i++) {
				if (i == 4) {
					int tmp = x[0];
					x[0] = y[0];
					y[0] = tmp;
				}
				if (i % 2 == 0) {
					int tmp = x[1];
					x[1] = y[1];
					y[1] = tmp;
				}
				int tmp = x[2];
				x[2] = y[2];
				y[2] = tmp;

//				System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

				if ((ret = isType2(x, y, c)) != null) {
					prRet(ret);

					sc.close();
					return;
				}
			}
		}

		System.out.println("-1");

		sc.close();
	}

	private static void prRet(char[][] ret) {
		System.out.println(ret.length);
		for (int i = 0; i < ret.length; i++) {
			System.out.println(ret[i]);
		}

		return;
	}

	private static char[][] isType1(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] && y[0] == y[2] && x[0] + x[1] + x[2] == y[0]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = 'A';
				}
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = 'B';
				}
				for (int j = x[0] + x[1]; j < x[0] + x[1] + x[2]; j++) {
					ret[i][j] = 'C';
				}
			}
		}

		return ret;
	}

	private static char[][] isType2(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] + y[2] && x[0] + x[1] == x[0] + x[2] && y[0] == x[0] + x[1]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = c[0];
				}
			}
			for (int i = 0; i < y[1]; i++) {
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = c[1];
				}
			}
			for (int i = y[1]; i < y[1] + y[2]; i++) {
				for (int j = x[0]; j < x[0] + x[2]; j++) {
					ret[i][j] = c[2];
				}
			}
		}

		return ret;
	}
}


import java.util.Scanner;

public class Main_Round322Div2_D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] x = new int[3];
		int[] y = new int[3];
		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}

		char[] c = {'A', 'B', 'C'};
		char[][] ret;

		for (int i = 0; i < 8; i++) {
			if (i == 4) {
				int tmp = x[0];
				x[0] = y[0];
				y[0] = tmp;
			}
			if (i % 2 == 0) {
				int tmp = x[1];
				x[1] = y[1];
				y[1] = tmp;
			}
			int tmp = x[2];
			x[2] = y[2];
			y[2] = tmp;

//			System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

			if ((ret = isType1(x, y, c)) != null) {
				prRet(ret);

				sc.close();
				return;
			}
		}

		for (int j = 0; j < 3; j++) {
			char ctmp = c[0];
			c[0] = c[1];
			c[1] = c[2];
			c[2] = ctmp;
			int[] itmp = new int[2];
			itmp[0] = x[0];
			itmp[1] = y[0];
			x[0] = x[1];
			y[0] = y[1];
			x[1] = x[2];
			y[1] = y[2];
			x[2] = itmp[0];
			y[2] = itmp[1];

			for (int i = 0; i < 8; i++) {
				if (i == 4) {
					int tmp = x[0];
					x[0] = y[0];
					y[0] = tmp;
				}
				if (i % 2 == 0) {
					int tmp = x[1];
					x[1] = y[1];
					y[1] = tmp;
				}
				int tmp = x[2];
				x[2] = y[2];
				y[2] = tmp;

//				System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

				if ((ret = isType2(x, y, c)) != null) {
					prRet(ret);

					sc.close();
					return;
				}
			}
		}

		sc.close();
	}

	private static void prRet(char[][] ret) {
		for (int i = 0; i < ret.length; i++) {
			System.out.println(ret[i]);
		}

		return;
	}

	private static char[][] isType1(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] && y[0] == y[2] && x[0] + x[1] + x[2] == y[0]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = 'A';
				}
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = 'B';
				}
				for (int j = x[0] + x[1]; j < x[0] + x[1] + x[2]; j++) {
					ret[i][j] = 'C';
				}
			}
		}

		return ret;
	}

	private static char[][] isType2(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] + y[2] && x[0] + x[1] == x[0] + x[2] && y[0] == x[0] + x[1]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = c[0];
				}
			}
			for (int i = 0; i < y[1]; i++) {
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = c[1];
				}
			}
			for (int i = y[1]; i < y[1] + y[2]; i++) {
				for (int j = x[0]; j < x[0] + x[2]; j++) {
					ret[i][j] = c[2];
				}
			}
		}

		return ret;
	}
}


import java.util.Scanner;

public class Main_Round322Div2_D {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int[] x = new int[3];
		int[] y = new int[3];
		for (int i = 0; i < 3; i++) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}

		char[] c = {'A', 'B', 'C'};
		char[][] ret;

		for (int i = 0; i < 8; i++) {
			if (i == 4) {
				int tmp = x[0];
				x[0] = y[0];
				y[0] = tmp;
			}
			if (i % 2 == 0) {
				int tmp = x[1];
				x[1] = y[1];
				y[1] = tmp;
			}
			int tmp = x[2];
			x[2] = y[2];
			y[2] = tmp;

//			System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

			if ((ret = isType1(x, y, c)) != null) {
				prRet(ret);

				sc.close();
				return;
			}
		}

		for (int j = 0; j < 3; j++) {
			char ctmp = c[0];
			c[0] = c[1];
			c[1] = c[2];
			c[2] = ctmp;
			int[] itmp = new int[2];
			itmp[0] = x[0];
			itmp[1] = y[0];
			x[0] = x[1];
			y[0] = y[1];
			x[1] = x[2];
			y[1] = y[2];
			x[2] = itmp[0];
			y[2] = itmp[1];

			for (int i = 0; i < 8; i++) {
				if (i == 4) {
					int tmp = x[0];
					x[0] = y[0];
					y[0] = tmp;
				}
				if (i % 2 == 0) {
					int tmp = x[1];
					x[1] = y[1];
					y[1] = tmp;
				}
				int tmp = x[2];
				x[2] = y[2];
				y[2] = tmp;

//				System.out.printf("%d %d %d %d %d %d\n", x[0], y[0], x[1], y[1], x[2], y[2]);

				if ((ret = isType2(x, y, c)) != null) {
					prRet(ret);

					sc.close();
					return;
				}
			}
		}

		sc.close();
	}

	private static void prRet(char[][] ret) {
		System.out.println(ret.length);
		for (int i = 0; i < ret.length; i++) {
			System.out.println(ret[i]);
		}

		return;
	}

	private static char[][] isType1(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] && y[0] == y[2] && x[0] + x[1] + x[2] == y[0]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = 'A';
				}
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = 'B';
				}
				for (int j = x[0] + x[1]; j < x[0] + x[1] + x[2]; j++) {
					ret[i][j] = 'C';
				}
			}
		}

		return ret;
	}

	private static char[][] isType2(int[] x, int[] y, char[] c) {
		char[][] ret = null;

		if (y[0] == y[1] + y[2] && x[0] + x[1] == x[0] + x[2] && y[0] == x[0] + x[1]) {
			ret = new char[y[0]][y[0]];
			for (int i = 0; i < y[0]; i++) {
				for (int j = 0; j < x[0]; j++) {
					ret[i][j] = c[0];
				}
			}
			for (int i = 0; i < y[1]; i++) {
				for (int j = x[0]; j < x[0] + x[1]; j++) {
					ret[i][j] = c[1];
				}
			}
			for (int i = y[1]; i < y[1] + y[2]; i++) {
				for (int j = x[0]; j < x[0] + x[2]; j++) {
					ret[i][j] = c[2];
				}
			}
		}

		return ret;
	}
}


/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	var List = __webpack_require__(1);
	var xy = List.map(parseInt, readline().split(' '));
	var Rect = (function () {
	    function Rect(width, height, label) {
	        this.width = width;
	        this.height = height;
	        this.label = label;
	    }
	    Rect.prototype.rotated = function () {
	        return new Rect(this.height, this.width, this.label);
	    };
	    return Rect;
	})();
	var rects = [];
	var label = ["A", "B", "C"];
	for (var i = 0; i < 3; i++) {
	    rects.push(new Rect(xy[2 * i], xy[2 * i + 1], label[i]));
	}
	var infinity = 100000000;
	function square(n) {
	    return List.map(function (_) { return List.replicate(n, "."); }, List.replicate(n, []));
	}
	function draw(canvas, x, y, r) {
	    for (var i = x; i < x + r.width; i++) {
	        for (var j = y; j < y + r.height; j++) {
	            canvas[i][j] = r.label;
	        }
	    }
	}
	function output(canvas) {
	    print(canvas.length);
	    print(List.map(function (s) { return s.join(""); }, canvas).join("\n"));
	}
	function fit(rect) {
	    var width = rect[0].width;
	    var height = rect[0].height;
	    if (rects[1].width > width)
	        return false;
	    height += rect[1].height;
	    if (rect[2].width + rect[1].width === width) {
	        if (rect[2].height !== rect[1].height)
	            return false;
	        if (height !== width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, rect[1].width, rect[0].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	    else {
	        if (rect[1].width != width || rect[2].width != width)
	            return false;
	        height += rect[2].height;
	        if (height != width)
	            return false;
	        var canvas = square(width);
	        draw(canvas, 0, 0, rect[0]);
	        draw(canvas, 0, rect[0].height, rect[1]);
	        draw(canvas, 0, rect[0].height + rect[1].height, rect[2]);
	        output(canvas);
	        return true;
	    }
	}
	var found = false;
	for (var rotation = 0; rotation < 8 && !found; rotation++) {
	    var rotated = [];
	    for (var i = 0; i < 3; i++) {
	        var should_rotate = ((rotation >> i) & 1) !== 0;
	        rotated.push(should_rotate ? rects[i].rotated() : rects[i]);
	    }
	    var p = List.range(0, 2);
	    do {
	        found = found || fit(List.apply_permutation(p, rotated));
	    } while ((p = List.next_permutation(p)) && !found);
	}
	if (!found)
	    print("-1");

/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {

	var Prelude_1 = __webpack_require__(2);
	function add(xs, ys) {
	    return xs.concat(ys);
	}
	exports.add = add;
	function head(xs) {
	    return xs[0];
	}
	exports.head = head;
	function last(xs) {
	    return xs[xs.length - 1];
	}
	exports.last = last;
	function tail(xs) {
	    return xs.slice(1);
	}
	exports.tail = tail;
	function init(xs) {
	    return xs.slice(0, xs.length - 1);
	}
	exports.init = init;
	function map(f, xs) {
	    var result = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        result[i] = f(xs[i]);
	    }
	    return result;
	}
	exports.map = map;
	function reverse(xs) {
	    return xs.slice().reverse();
	}
	exports.reverse = reverse;
	function intersperse(x, xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = new Array(xs.length + xs.length - 1);
	    for (var i = 0; i + 1 < xs.length; i++) {
	        result[i + i] = xs[i];
	        result[i + i + 1] = x;
	    }
	    result[result.length - 1] = xs[xs.length - 1];
	    return result;
	}
	exports.intersperse = intersperse;
	function intercalate(xs, xss) {
	    return concat(intersperse(xs, xss));
	}
	exports.intercalate = intercalate;
	function foldl(f, initial, xs) {
	    var result = initial;
	    for (var i = 0; i < xs.length; i++) {
	        result = f(result, xs[i]);
	    }
	    return result;
	}
	exports.foldl = foldl;
	function foldr(f, initial, xs) {
	    var result = initial;
	    for (var i = xs.length - 1; i >= 0; i--) {
	        result = f(xs[i], result);
	    }
	    return result;
	}
	exports.foldr = foldr;
	function concat(xss) {
	    var total = sum(map(function (xs) { return xs.length; }, xss));
	    var result = new Array(total);
	    var m = 0;
	    for (var i = 0; i < xss.length; i++) {
	        var xs = xss[i];
	        for (var j = 0; j < xs.length; j++) {
	            result[m++] = xs[j];
	        }
	    }
	    return result;
	}
	exports.concat = concat;
	function sum(xs) {
	    var result = 0;
	    for (var i = 0; i < xs.length; i++) {
	        result += xs[i];
	    }
	    return result;
	}
	exports.sum = sum;
	function product(xs) {
	    var result = 1;
	    for (var i = 0; i < xs.length; i++) {
	        result *= xs[i];
	    }
	    return result;
	}
	exports.product = product;
	function maximum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result < xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.maximum = maximum;
	function minimum(xs) {
	    var result = xs[0];
	    for (var i = 1; i < xs.length; i++) {
	        if (result > xs[i])
	            result = xs[i];
	    }
	    return result;
	}
	exports.minimum = minimum;
	function replicate(n, x) {
	    var result = new Array(n);
	    for (var i = 0; i < result.length; i++) {
	        result[i] = x;
	    }
	    return result;
	}
	exports.replicate = replicate;
	function take(n, xs) {
	    return xs.slice(0, n);
	}
	exports.take = take;
	function drop(n, xs) {
	    return xs.slice(n);
	}
	exports.drop = drop;
	function splitAt(n, xs) {
	    return [take(n, xs), drop(n, xs)];
	}
	exports.splitAt = splitAt;
	function takeWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(0, i);
	        }
	    }
	    return xs.slice();
	}
	exports.takeWhile = takeWhile;
	function dropWhile(f, xs) {
	    for (var i = 0; i < xs.length; i++) {
	        if (!f(xs[i])) {
	            return xs.slice(i);
	        }
	    }
	    return [];
	}
	exports.dropWhile = dropWhile;
	function group(xs) {
	    if (xs.length == 0) {
	        return [];
	    }
	    var result = [];
	    var last = [xs[0]];
	    for (var i = 1; i < xs.length; i++) {
	        if (last[0] === xs[i]) {
	            last.push(xs[i]);
	        }
	        else {
	            result.push(last);
	            last = [xs[i]];
	        }
	    }
	    result.push(last);
	    return result;
	}
	exports.group = group;
	function filter(f, xs) {
	    var result = [];
	    for (var i = 0; i < xs.length; i++) {
	        if (f(xs[i]))
	            result.push(xs[i]);
	    }
	    return result;
	}
	exports.filter = filter;
	function zip(xs, ys) {
	    var n = Prelude_1.min(xs.length, ys.length);
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = [xs[i], ys[i]];
	    }
	    return result;
	}
	exports.zip = zip;
	function unzip(xs) {
	    var r1 = new Array(xs.length);
	    var r2 = new Array(xs.length);
	    for (var i = 0; i < xs.length; i++) {
	        r1[i] = xs[i][0];
	        r2[i] = xs[i][1];
	    }
	    return [r1, r2];
	}
	exports.unzip = unzip;
	function range(from, to) {
	    var result = Array(to - from + 1);
	    for (var i = from; i <= to; i++) {
	        result[i - from] = i;
	    }
	    return result;
	}
	exports.range = range;
	function copy(xs) {
	    return xs.slice(0);
	}
	exports.copy = copy;
	function apply_permutation(p, xs) {
	    var n = xs.length;
	    var result = new Array(n);
	    for (var i = 0; i < n; i++) {
	        result[i] = xs[p[i]];
	    }
	    return result;
	}
	exports.apply_permutation = apply_permutation;
	function next_permutation(p) {
	    var n = p.length;
	    if (n < 2)
	        return null;
	    var r = copy(p);
	    var k = n - 2;
	    for (; k >= 0 && r[k] >= r[k + 1]; k--)
	        ;
	    if (k < 0)
	        return null;
	    for (var i = k + 1, j = n - 1; i < j; i++, j--) {
	        var t_1 = r[i];
	        r[i] = r[j];
	        r[j] = t_1;
	    }
	    var next = k + 1;
	    for (; r[next] <= r[k]; next++)
	        ;
	    var t = r[k];
	    r[k] = r[next];
	    r[next] = t;
	    return r;
	}
	exports.next_permutation = next_permutation;

/***/ },
/* 2 */
/***/ function(module, exports) {

	function min(a, b) {
	    return a < b ? a : b;
	}
	exports.min = min;
	function max(a, b) {
	    return a < b ? b : a;
	}
	exports.max = max;
	function curry(f) {
	    return function (x) { return function (y) { return f(x, y); }; };
	}
	exports.curry = curry;
	function uncurry(f) {
	    return function (x, y) { return f(x)(y); };
	}
	exports.uncurry = uncurry;
	function id(x) {
	    return x;
	}
	exports.id = id;
	function constant(x) {
	    return function (_) { return x; };
	}
	exports.constant = constant;
	function flip(f) {
	    return function (y) { return function (x) { return f(x)(y); }; };
	}
	exports.flip = flip;
	function flip2(f) {
	    return function (y, x) { return f(x, y); };
	}
	exports.flip2 = flip2;
	function compose(g, f) {
	    return function (x) { return g(f(x)); };
	}
	exports.compose = compose;

/***/ }
/******/ ]);