Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area. 

Advertisers will put up the ad only if it is possible to place all three logos on the billboard so that they do not overlap and the billboard has no empty space left. When you put a logo on the billboard, you should rotate it so that the sides were parallel to the sides of the billboard.

Your task is to determine if it is possible to put the logos of all the three companies on some square billboard without breaking any of the described rules.

Input

The first line of the input contains six positive integers x1, y1, x2, y2, x3, y3 (1 ≤ x1, y1, x2, y2, x3, y3 ≤ 100), where xi and yi determine the length and width of the logo of the i-th company respectively.

Output

If it is impossible to place all the three logos on a square shield, print a single integer "-1" (without the quotes).

If it is possible, print in the first line the length of a side of square n, where you can place all the three logos. Each of the next n lines should contain n uppercase English letters "A", "B" or "C". The sets of the same letters should form solid rectangles, provided that:

  * the sizes of the rectangle composed from letters "A" should be equal to the sizes of the logo of the first company, 
  * the sizes of the rectangle composed from letters "B" should be equal to the sizes of the logo of the second company, 
  * the sizes of the rectangle composed from letters "C" should be equal to the sizes of the logo of the third company, 



Note that the logos of the companies can be rotated for printing on the billboard. The billboard mustn't have any empty space. If a square billboard can be filled with the logos in multiple ways, you are allowed to print any of them.

See the samples to better understand the statement.

Examples

Input

5 1 2 5 5 2


Output

5
AAAAA
BBBBB
BBBBB
CCCCC
CCCCC


Input

4 4 2 6 4 2


Output

6
BBBBBB
BBBBBB
AAAACC
AAAACC
AAAACC
AAAACC
#include <bits/stdc++.h>
using namespace std;
const long long base = (long long)1e17;
const int N = 1e5 + 100;
const int mod = 1e9 + 7;
const long long tbase = base % mod;
inline void read(int& n) {
  n = 0;
  int ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) n = n * 10 + ch - '0', ch = getchar();
}
int x[3][2];
int main() {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 2; j++) scanf("%d", &x[i][j]);
  bool flag = false;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) {
        if (x[0][i] == x[1][j] && x[1][j] == x[2][k]) {
          int wid = x[0][i];
          if (x[0][i ^ 1] + x[1][j ^ 1] + x[2][k ^ 1] != wid) continue;
          printf("%d\n", wid);
          for (int q = 0; q < x[0][i ^ 1]; q++) {
            for (int l = 0; l < wid; l++) printf("A");
            printf("\n");
          }
          for (int q = 0; q < x[1][j ^ 1]; q++) {
            for (int l = 0; l < wid; l++) printf("B");
            printf("\n");
          }
          for (int q = 0; q < x[2][k ^ 1]; q++) {
            for (int l = 0; l < wid; l++) printf("C");
            printf("\n");
          }
          return 0;
        }
      }
  for (int ii = 0; ii < 3; ii++)
    for (int jj = 0; jj < 2; jj++) {
      int wid = x[ii][jj];
      int p[2], cc = 0;
      for (int k = 0; k < 3; k++)
        if (k != ii) p[cc++] = k;
      for (int c1 = 0; c1 < 2; c1++)
        for (int c2 = 0; c2 < 2; c2++) {
          if (x[p[0]][c1] + x[p[1]][c2] == wid &&
              x[p[0]][c1 ^ 1] == x[p[1]][c2 ^ 1] &&
              x[p[0]][c1 ^ 1] + x[ii][jj ^ 1] == wid) {
            printf("%d\n", wid);
            for (int i = 0; i < x[ii][jj ^ 1]; i++) {
              for (int j = 0; j < wid; j++) printf("%c", 'A' + ii);
              printf("\n");
            }
            for (int i = 0; i < x[p[0]][c1 ^ 1]; i++) {
              for (int j = 0; j < x[p[0]][c1] + x[p[1]][c2]; j++) {
                if (j < x[p[0]][c1])
                  printf("%c", 'A' + p[0]);
                else
                  printf("%c", 'A' + p[1]);
              }
              printf("\n");
            }
            return 0;
          }
        }
    }
  printf("-1\n");
  return 0;
}
