#include <bits/stdc++.h>
using namespace std;
int X1, X2, X3, Y1, Y2, Y3;
int r[10];
int main() {
  int i, j;
  for (i = 1; i <= 3; i++) r[i] = i - 1;
  while (~scanf("%d%d%d%d%d%d", &X1, &Y1, &X2, &Y2, &X3, &Y3)) {
    if (X1 > Y1) swap(X1, Y1);
    if (X2 > Y2) swap(X2, Y2);
    if (X3 > Y3) swap(X3, Y3);
    if (Y1 < Y2) {
      swap(r[1], r[2]);
      swap(X1, X2);
      swap(Y1, Y2);
    }
    if (Y1 < Y3) {
      swap(r[1], r[3]);
      swap(X1, X3);
      swap(Y1, Y3);
    }
    if (X1 + Y2 == Y1 && X1 + Y3 == Y1 && X2 + X3 == Y1) {
      printf("%d\n", Y1);
      for (i = 0; i < X1; i++) {
        for (j = 0; j < Y1; j++) printf("%c", 'A' + r[1]);
        printf("\n");
      }
      for (i = 0; i < Y2; i++) {
        for (j = 0; j < X2; j++) printf("%c", 'A' + r[2]);
        for (j = 0; j < X3; j++) printf("%c", 'A' + r[3]);
        printf("\n");
      }
      continue;
    } else if (X1 + X2 == Y1 && X1 + Y3 == Y1 && Y2 + X3 == Y1) {
      printf("%d\n", Y1);
      for (i = 0; i < X1; i++) {
        for (j = 0; j < Y1; j++) printf("%c", 'A' + r[1]);
        printf("\n");
      }
      for (i = 0; i < X2; i++) {
        for (j = 0; j < Y2; j++) printf("%c", 'A' + r[2]);
        for (j = 0; j < X3; j++) printf("%c", 'A' + r[3]);
        printf("\n");
      }
      continue;
    } else if (X1 + Y2 == Y1 && X1 + X3 == Y1 && X2 + Y3 == Y1) {
      printf("%d\n", Y1);
      for (i = 0; i < X1; i++) {
        for (j = 0; j < Y1; j++) printf("%c", 'A' + r[1]);
        printf("\n");
      }
      for (i = 0; i < Y2; i++) {
        for (j = 0; j < X2; j++) printf("%c", 'A' + r[2]);
        for (j = 0; j < Y3; j++) printf("%c", 'A' + r[3]);
        printf("\n");
      }
      continue;
    } else if (X1 + X2 == Y1 && X1 + X3 == Y1 && Y2 + Y3 == Y1) {
      printf("%d\n", Y1);
      for (i = 0; i < X1; i++) {
        for (j = 0; j < Y1; j++) printf("%c", 'A' + r[1]);
        printf("\n");
      }
      for (i = 0; i < X2; i++) {
        for (j = 0; j < Y2; j++) printf("%c", 'A' + r[2]);
        for (j = 0; j < Y3; j++) printf("%c", 'A' + r[3]);
        printf("\n");
      }
      continue;
    } else if (Y2 == Y1 && Y3 == Y1 && X1 + X2 + X3 == Y1) {
      printf("%d\n", Y1);
      for (i = 0; i < X1; i++) {
        for (j = 0; j < Y1; j++) printf("%c", 'A' + r[1]);
        printf("\n");
      }
      for (i = 0; i < X2; i++) {
        for (j = 0; j < Y2; j++) printf("%c", 'A' + r[2]);
        printf("\n");
      }
      for (i = 0; i < X3; i++) {
        for (j = 0; j < Y3; j++) printf("%c", 'A' + r[3]);
        printf("\n");
      }
      continue;
    }
    printf("-1\n");
  }
  return 0;
}
