#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, x2, y2, x3, y3;
  while (scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3) != EOF) {
    int area = x1 * y1 + x2 * y2 + x3 * y3;
    int k = sqrt(area);
    if (k * k == area) {
      if (y1 == k) swap(x1, y1);
      if (y2 == k) swap(x2, y2);
      if (y3 == k) swap(x3, y3);
      if (x1 == k && x2 == k && x3 == k) {
        printf("%d\n", k);
        for (int i = 1; i <= y1; i++) {
          for (int j = 1; j <= x1; j++) printf("A");
          printf("\n");
        }
        for (int i = 1; i <= y2; i++) {
          for (int j = 1; j <= x2; j++) printf("B");
          printf("\n");
        }
        for (int i = 1; i <= y3; i++) {
          for (int j = 1; j <= x3; j++) printf("C");
          printf("\n");
        }
        continue;
      }
      int sd = 0;
      if (x2 == k) {
        sd = 1;
        swap(x1, x2);
        swap(y1, y2);
      }
      if (x3 == k) {
        sd = 2;
        swap(x1, x3);
        swap(y1, y3);
      }
      if (y2 == k - y1) {
        swap(x2, y2);
      }
      if (y3 == k - y1) {
        swap(x3, y3);
      }
      if (x2 == k - y1 && x3 == k - y1 && y2 + y3 == k) {
        printf("%d\n", k);
        for (int i = 1; i <= y1; i++) {
          for (int j = 1; j <= x1; j++) printf("%c", 'A' + sd);
          printf("\n");
        }
        if (sd == 0) {
          for (int i = 1; i <= x2; i++) {
            for (int j = 1; j <= y2; j++) printf("%c", 'B');
            for (int j = 1; j <= y3; j++) printf("%c", 'C');
            printf("\n");
          }
        }
        if (sd == 1) {
          for (int i = 1; i <= x2; i++) {
            for (int j = 1; j <= y2; j++) printf("%c", 'A');
            for (int j = 1; j <= y3; j++) printf("%c", 'C');
            printf("\n");
          }
        }
        if (sd == 2) {
          for (int i = 1; i <= x2; i++) {
            for (int j = 1; j <= y2; j++) printf("%c", 'B');
            for (int j = 1; j <= y3; j++) printf("%c", 'A');
            printf("\n");
          }
        }
        continue;
      } else {
        printf("-1\n");
      }
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
