#include <bits/stdc++.h>
using namespace std;
int ax, ay, bx, by, cx, cy;
int n;
int f[111][111];
int in1, in2, in3;
int k1, k2, k3;
int ok;
void work(int k, int fx, int fy, int tx, int ty) {
  for (int i = fx; i <= tx; i++)
    for (int j = fy; j <= ty; j++) f[i][j] = k;
}
void print() {
  printf("%d\n", n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) printf("%c", f[i][j] - 1 + 'A');
    printf("\n");
  }
}
int main() {
  scanf("%d%d%d%d%d%d", &ax, &ay, &bx, &by, &cx, &cy);
  k1 = 1;
  k2 = 2;
  k3 = 3;
  if (ax < ay) swap(ax, ay);
  if (bx < by) swap(bx, by);
  if (cx < cy) swap(cx, cy);
  n = max(n, ax);
  n = max(n, ay);
  n = max(n, bx);
  n = max(n, by);
  n = max(n, cx);
  n = max(n, cy);
  if (ax == n) in1 = 1;
  if (bx == n) in2 = 1;
  if (cx == n) in3 = 1;
  if (in1 && in2 && in3) {
    if (ay + by + cy == n) {
      ok = 1;
      work(1, 1, 1, ay, n);
      work(2, ay + 1, 1, ay + by, n);
      work(3, ay + by + 1, 1, n, n);
      print();
    } else {
      ok = 0;
    }
  } else {
    if ((in1 && in2) || (in1 && in3) || (in2 && in3))
      ok = 0;
    else {
      if (ax < bx) {
        swap(ax, bx);
        swap(ay, by);
        swap(in1, in2);
        swap(k1, k2);
      }
      if (ax < cx) {
        swap(ax, cx);
        swap(ay, cy);
        swap(in1, in3);
        swap(k1, k3);
      }
      work(k1, 1, 1, ay, n);
      if (bx + ay == n) {
        work(k2, ay + 1, 1, n, by);
        if (cx == bx) {
          if (cy + by == n) {
            work(k3, ay + 1, by + 1, n, n);
            ok = 1;
            print();
          } else
            ok = 0;
        } else if (cy == bx) {
          if (cx + by == n) {
            work(k3, ay + 1, by + 1, n, n);
            ok = 1;
            print();
          } else
            ok = 0;
        } else
          ok = 0;
      } else if (by + ay == n) {
        work(k2, ay + 1, 1, n, bx);
        if (cx == by) {
          if (cy + bx == n) {
            work(k3, ay + 1, bx + 1, n, n);
            ok = 1;
            print();
          } else
            ok = 0;
        } else if (cy == by) {
          if (cx + bx == n) {
            work(k3, ay + 1, bx + 1, n, n);
            ok = 1;
            print();
          } else
            ok = 0;
        } else
          ok = 0;
      } else
        ok = 0;
    }
  }
  if (!ok) printf("-1\n");
  return 0;
}
