#include <bits/stdc++.h>
typedef struct point {
  int x, y;
  char c;
};
int alignV(int length, int value) {
  if (length == value)
    return 0;
  else
    return length;
}
int comp(const void* a, const void* b) {
  point s = *(point*)a;
  point e = *(point*)b;
  if (s.x > e.x)
    return -1;
  else if (s.x == e.x)
    return e.y - s.y;
  return 1;
}
int main() {
  int i, j, k, l;
  int rr, cc;
  point par[3];
  scanf("%d %d %d %d %d %d", &par[0].x, &par[0].y, &par[1].x, &par[1].y,
        &par[2].x, &par[2].y);
  j = par[0].x * par[0].y + par[1].x * par[1].y + par[2].x * par[2].y;
  par[0].c = 'A';
  par[1].c = 'B';
  par[2].c = 'C';
  k = sqrt(j);
  char out[k][k];
  if (k * k != j) {
    printf("-1\n");
    return 0;
  }
  int ok = 0;
  for (i = 0; i < 3; i++) {
    if (par[i].x < par[i].y) {
      l = par[i].x;
      par[i].x = par[i].y;
      par[i].y = l;
    }
    if (par[i].x == k) ok = 1;
    if (par[i].x > k) {
      ok = 0;
      break;
    }
  }
  if (ok == 0) {
    printf("-1\n");
    return 0;
  } else {
    qsort(par, 3, sizeof(point), comp);
    if (par[0].x == par[1].x and par[1].x == par[2].x) {
      for (i = 0; i < par[0].x; i++)
        for (j = 0; j < par[0].y; j++) out[i][j] = par[0].c;
      cc = par[0].y;
      for (i = 0; i < par[1].x; i++)
        for (j = 0; j < par[1].y; j++) out[i][cc + j] = par[1].c;
      cc += par[1].y;
      for (i = 0; i < par[2].x; i++)
        for (j = 0; j < par[2].y; j++) out[i][cc + j] = par[2].c;
    } else {
      for (i = 0; i < par[0].x; i++)
        for (j = 0; j < par[0].y; j++) out[i][j] = par[0].c;
      if (par[0].y + par[1].y != k) {
        l = par[1].y;
        par[1].y = par[1].x;
        par[1].x = l;
      }
      cc = par[0].y;
      for (i = 0; i < par[1].x; i++)
        for (j = 0; j < par[1].y; j++) out[i][cc + j] = par[1].c;
      if (par[1].x + par[2].x != k) {
        l = par[2].y;
        par[2].y = par[2].x;
        par[2].x = l;
      }
      rr = par[1].x;
      for (i = 0; i < par[2].x; i++)
        for (j = 0; j < par[2].y; j++) out[rr + i][cc + j] = par[2].c;
    }
    printf("%d\n", k);
    for (i = 0; i < k; i++) {
      for (j = 0; j < k; j++) printf("%c", out[i][j]);
      printf("\n");
    }
  }
  return 0;
}
