#include <bits/stdc++.h>
using namespace std;
int n, m;
int flag, sum, ave, ans, res, len, ans1, ans2;
int a[11], b[11];
char s[101];
struct node {
  int x, y;
  int r, w;
  int to, next;
  void init() { r = 0; }
  friend bool operator<(node a, node b) { return a.r > b.r; }
} tn;
int main() {
  int i, j, k, kk, t, x, y, z;
  while (scanf("%d%d%d%d%d%d", &a[0], &b[0], &a[1], &b[1], &a[2], &b[2]) !=
         EOF) {
    if (a[0] < b[0]) {
      t = a[0];
      a[0] = b[0];
      b[0] = t;
    }
    if (a[1] < b[1]) {
      t = a[1];
      a[1] = b[1];
      b[1] = t;
    }
    if (a[2] < b[2]) {
      t = a[2];
      a[2] = b[2];
      b[2] = t;
    }
    if (a[0] == a[1] && a[0] == a[2] && a[0] == (b[0] + b[1] + b[2])) {
      printf("%d\n", a[0]);
      for (i = 0; i < 3; i++) {
        for (j = 0; j < b[i]; j++) {
          for (k = 0; k < a[0]; k++) printf("%c", 'A' + i);
          printf("\n");
        }
      }
    } else {
      flag = 1;
      if (flag) {
        x = 0;
        y = 1;
        z = 2;
        if (a[x] == a[y] + a[z] && b[y] == b[z] && a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == b[y] + a[z] && a[y] == b[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == a[y] + b[z] && b[y] == a[z] &&
                   a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == b[y] + b[z] && a[y] == a[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == a[y] + a[z] && b[y] == b[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == b[y] + a[z] && a[y] == b[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == a[y] + b[z] && b[y] == a[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == b[y] + b[z] && a[y] == a[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'A');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        }
      }
      if (flag) {
        x = 1;
        y = 0;
        z = 2;
        if (a[x] == a[y] + a[z] && b[y] == b[z] && a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'A');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == b[y] + a[z] && a[y] == b[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'A');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == a[y] + b[z] && b[y] == a[z] &&
                   a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'A');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (a[x] == b[y] + b[z] && a[y] == a[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'A');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == a[y] + a[z] && b[y] == b[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'A');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == b[y] + a[z] && a[y] == b[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'A');
            for (j = 0; j < a[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == a[y] + b[z] && b[y] == a[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'A');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        } else if (b[x] == b[y] + b[z] && a[y] == a[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'B');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'A');
            for (j = 0; j < b[z]; j++) printf("C");
            printf("\n");
          }
        }
      }
      if (flag) {
        x = 2;
        y = 1;
        z = 0;
        if (a[x] == a[y] + a[z] && b[y] == b[z] && a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("A");
            printf("\n");
          }
        } else if (a[x] == b[y] + a[z] && a[y] == b[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("A");
            printf("\n");
          }
        } else if (a[x] == a[y] + b[z] && b[y] == a[z] &&
                   a[x] == (b[x] + b[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("A");
            printf("\n");
          }
        } else if (a[x] == b[y] + b[z] && a[y] == a[z] &&
                   a[x] == (b[x] + a[y])) {
          flag = 0;
          printf("%d\n", a[x]);
          for (i = 0; i < b[x]; i++) {
            for (j = 0; j < a[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("A");
            printf("\n");
          }
        } else if (b[x] == a[y] + a[z] && b[y] == b[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("A");
            printf("\n");
          }
        } else if (b[x] == b[y] + a[z] && a[y] == b[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < a[z]; j++) printf("A");
            printf("\n");
          }
        } else if (b[x] == a[y] + b[z] && b[y] == a[z] &&
                   b[x] == (a[x] + b[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < b[y]; i++) {
            for (j = 0; j < a[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("A");
            printf("\n");
          }
        } else if (b[x] == b[y] + b[z] && a[y] == a[z] &&
                   b[x] == (a[x] + a[y])) {
          flag = 0;
          printf("%d\n", b[x]);
          for (i = 0; i < a[x]; i++) {
            for (j = 0; j < b[x]; j++) printf("%c", 'C');
            printf("\n");
          }
          for (i = 0; i < a[y]; i++) {
            for (j = 0; j < b[y]; j++) printf("%c", 'B');
            for (j = 0; j < b[z]; j++) printf("A");
            printf("\n");
          }
        }
      }
      if (flag) printf("-1\n");
    }
  }
  return 0;
}
