#include <bits/stdc++.h>
using namespace std;
struct Toado {
  int x, y;
};
int x[4], y[4];
int a[4];
int b[4];
Toado c[4];
int nsize = 0;
void printresult() {
  char res[300][300];
  cout << nsize << endl;
  for (int k = 1; k <= 3; k++)
    for (int i = c[k].x; i <= c[k].x + x[k] - 1; i++)
      for (int j = c[k].y; j <= c[k].y + y[k] - 1; j++) {
        if (k == 1) res[i][j] = 'A';
        if (k == 2) res[i][j] = 'B';
        if (k == 3) res[i][j] = 'C';
      }
  for (int i = 1; i <= nsize; i++) {
    for (int j = 1; j <= nsize; j++) printf("%c", res[i][j]);
    printf("\n");
  }
}
void swap(int &x, int &y) {
  int tmp = x;
  x = y;
  y = tmp;
}
int main() {
  nsize = 0;
  for (int i = 1; i <= 3; i++) {
    scanf("%d%d", &x[i], &y[i]);
    nsize += x[i] * y[i];
    if (x[i] > y[i]) swap(x[i], y[i]);
  }
  if (nsize != (floor(sqrt(nsize)) * floor(sqrt(nsize)))) {
    cout << -1;
    return 0;
  }
  nsize = floor(sqrt(nsize));
  for (int i = 1; i <= 3; i++) {
    if (y[i] > nsize) {
      cout << -1;
      return 0;
    }
  }
  if ((y[1] == nsize && y[2] == nsize && y[3] != nsize) ||
      (y[1] == nsize && y[2] != nsize && y[3] == nsize) ||
      (y[1] != nsize && y[2] == nsize && y[3] == nsize) ||
      (y[1] != nsize && y[2] != nsize && y[3] != nsize)) {
    cout << -1;
    return 0;
  }
  if (y[1] == nsize && y[2] == nsize && y[3] == nsize) {
    if (x[1] + x[2] + x[3] != nsize) {
      cout << -1;
      return 0;
    } else {
      c[1].x = 1;
      c[1].y = 1;
      c[2].x = 1 + x[1];
      c[2].y = 1;
      c[3].x = 1 + x[1] + x[2];
      c[3].y = 1;
      printresult();
      return 0;
    }
  }
  int i1, i2, i3;
  for (int i = 1; i <= 3; i++) {
    if (y[i] == nsize) {
      i1 = i;
      break;
    }
  }
  switch (i1) {
    case 1: {
      i2 = 2;
      i3 = 3;
      break;
    }
    case 2: {
      i2 = 1;
      i3 = 3;
      break;
    }
    case 3: {
      i2 = 1;
      i3 = 2;
      break;
    } break;
  };
  int zz = nsize - x[i1];
  c[i1].x = 1;
  c[i1].y = 1;
  if (x[i2] == zz && x[i3] == zz && (y[i2] + y[i3] == nsize)) {
    c[i2].x = x[i1] + 1;
    c[i2].y = 1;
    c[i3].x = x[i1] + 1;
    c[i3].y = y[i2] + 1;
    printresult();
    return 0;
  }
  if (x[i2] == zz && y[i3] == zz && (y[i2] + x[i3] == nsize)) {
    swap(x[i3], y[i3]);
    c[i2].x = x[i1] + 1;
    c[i2].y = 1;
    c[i3].x = x[i1] + 1;
    c[i3].y = y[i2] + 1;
    printresult();
    return 0;
  }
  if (y[i2] == zz && x[i3] == zz && (x[i2] + y[i3] == nsize)) {
    swap(y[i2], x[i2]);
    c[i2].x = x[i1] + 1;
    c[i2].y = 1;
    c[i3].x = x[i1] + 1;
    c[i3].y = y[i2] + 1;
    printresult();
    return 0;
  }
  if (y[i2] == zz && y[i3] == zz && (x[i2] + x[i3] == nsize)) {
    swap(x[i2], y[i2]);
    swap(x[i3], y[i3]);
    c[i2].x = x[i1] + 1;
    c[i2].y = 1;
    c[i3].x = x[i1] + 1;
    c[i3].y = y[i2] + 1;
    printresult();
    return 0;
  }
  cout << -1;
  return 0;
}
