#include <bits/stdc++.h>
using namespace std;
int a[9][7];
bool as = 0;
char afis(int nr) {
  if (nr == 1) return 'A';
  if (nr == 3) return 'B';
  if (nr == 5) return 'C';
}
void backt(int i, int p1, int p2, int p3) {
  if (a[i][p1 + 1] == a[i][p2 + 1] && a[i][p3 + 1] == a[i][p2 + 1] &&
      (a[i][p1 + 1] == a[i][p1] + a[i][p2] + a[i][p3])) {
    as = 1;
    printf("%d\n", a[i][p1 + 1]);
    for (int k = 1; k <= a[i][p1]; k++) {
      for (int j = 1; j <= a[i][p1 + 1]; j++) printf("%c", afis(p1));
      printf("\n");
    }
    for (int k = 1; k <= a[i][p2]; k++) {
      for (int j = 1; j <= a[i][p2 + 1]; j++) printf("%c", afis(p2));
      printf("\n");
    }
    for (int k = 1; k <= a[i][p3]; k++) {
      for (int j = 1; j <= a[i][p3 + 1]; j++) printf("%c", afis(p3));
      printf("\n");
    }
  } else {
    if ((a[i][p1 + 1] == (a[i][p2 + 1] + a[i][p3 + 1])) &&
        (a[i][p2] == a[i][p3]) && (a[i][p1 + 1] == a[i][p2] + a[i][p1])) {
      as = 1;
      printf("%d\n", a[i][p1] + a[i][p2]);
      for (int k = 1; k <= a[i][p1]; k++) {
        for (int j = 1; j <= a[i][p1 + 1]; j++) printf("%c", afis(p1));
        printf("\n");
      }
      for (int k = 1; k <= a[i][p2]; k++) {
        for (int j = 1; j <= a[i][p2 + 1]; j++) printf("%c", afis(p2));
        for (int j = 1; j <= a[i][p3 + 1]; j++) printf("%c", afis(p3));
        printf("\n");
      }
    }
  }
}
int main() {
  scanf("%d%d%d%d%d%d", &a[1][1], &a[1][2], &a[1][3], &a[1][4], &a[1][5],
        &a[1][6]);
  for (int i = 2; i <= 8; i++) {
    for (int j = 1; j <= 6; j++) a[i][j] = a[i - 1][j];
  }
  swap(a[2][1], a[2][2]);
  swap(a[3][3], a[3][4]);
  swap(a[4][5], a[4][6]);
  swap(a[5][1], a[5][2]);
  swap(a[5][3], a[5][4]);
  swap(a[6][1], a[6][2]);
  swap(a[6][5], a[6][6]);
  swap(a[7][5], a[7][6]);
  swap(a[7][3], a[7][4]);
  swap(a[8][5], a[8][6]);
  swap(a[8][3], a[8][4]);
  swap(a[8][1], a[8][2]);
  for (int i = 1; i <= 8; i++) {
    backt(i, 1, 3, 5);
    if (as == 1) break;
    backt(i, 1, 5, 3);
    if (as == 1) break;
    backt(i, 3, 1, 5);
    if (as == 1) break;
    backt(i, 3, 5, 1);
    if (as == 1) break;
    backt(i, 5, 1, 3);
    if (as == 1) break;
    backt(i, 5, 3, 1);
    if (as == 1) break;
  }
  if (as == 0) printf("-1");
}
