#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int maxn = 100010;
char ma[1010][1010];
int x[10], y[10];
int n;
int E;
bool sp() {
  int e;
  for (int i = 1; i <= 3; i++) {
    if (x[i] != E && y[i] != E) return false;
    if (y[i] == E) swap(x[i], y[i]);
  }
  return true;
}
void print(int n) {
  printf("%d\n", n);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) putchar(ma[i][j]);
    putchar('\n');
  }
}
void draw(int x1, int y1, int x2, int y2, char ch) {
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      ma[i][j] = ch;
    }
  }
}
bool sp1() {
  int C[4];
  for (int i = 0; i < 3; i++) C[i] = i + 1;
  int BX, BY;
  int d[3][2];
  do {
    for (int t = 0; t < 8; t++) {
      for (int j = 0; j < 3; j++) {
        if ((t >> j) & 1) {
          d[j][0] = x[C[j]];
          d[j][1] = y[C[j]];
        } else {
          d[j][0] = y[C[j]];
          d[j][1] = x[C[j]];
        }
      }
      if (d[0][1] == E && d[0][0] + d[1][0] == E && d[0][0] + d[2][0] == E &&
          d[1][1] + d[2][1] == E) {
        draw(1, 1, d[0][0], d[0][1], C[0] + 'A' - 1);
        draw(d[0][0] + 1, 1, E, d[2][1], C[2] + 'A' - 1);
        draw(d[0][0] + 1, d[2][1] + 1, E, E, C[1] + 'A' - 1);
        print(E);
        return true;
      }
    }
  } while (next_permutation(C, C + 3));
  return false;
}
void work() {
  int a = 1, b = 1;
  if (sp()) {
    for (int i = 1; i <= 3; ++i)
      for (int j = 1; j <= y[i]; ++j)
        for (int k = 1; k <= E; ++k) {
          ma[a][b] = 'A' - 1 + i;
          b++;
          if (b > E) {
            b = 1;
            a++;
          }
        }
    print(E);
    return;
  }
  if (sp1()) {
    return;
  }
  printf("-1\n");
}
int main() {
  int s = 0;
  for (int i = 1; i <= 3; ++i) {
    scanf("%d%d", &x[i], &y[i]);
    s += x[i] * y[i];
  }
  E = -1;
  for (int i = 1; i <= 1000; i++) {
    if (i * i == s) {
      E = i;
      break;
    }
  }
  if (E == -1)
    printf("-1\n");
  else {
    work();
  }
  return 0;
}
