#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
void checkCase1(int a1, int a2, int b1, int b2, int c1, int c2) {
  if (a1 == b1 && a1 == c1 && a2 + b2 + c2 == a1) {
    printf("%d\n", a1);
    for (int i = 0; i < a2; ++i) {
      for (int j = 0; j < a1; ++j) {
        printf("A");
      }
      printf("\n");
    }
    for (int i = 0; i < b2; ++i) {
      for (int j = 0; j < b1; ++j) {
        printf("B");
      }
      printf("\n");
    }
    for (int i = 0; i < c2; ++i) {
      for (int j = 0; j < c1; ++j) {
        printf("C");
      }
      printf("\n");
    }
    exit(0);
  }
}
void checkCase2(int a1, int a2, char a, int b1, int b2, char b, int c1, int c2,
                char c) {
  if (a1 == c1 && a1 + b1 == b2 && a2 + c2 == b2) {
    printf("%d\n", a2 + c2);
    for (int i = 0; i < b1; ++i) {
      for (int j = 0; j < b2; ++j) {
        printf("%c", b);
      }
      printf("\n");
    }
    for (int i = 0; i < a1; ++i) {
      for (int j = 0; j < a2 + c2; ++j) {
        if (j < a2)
          printf("%c", a);
        else
          printf("%c", c);
      }
      printf("\n");
    }
    exit(0);
  }
}
void check(int a1, int a2, int b1, int b2, int c1, int c2) {
  checkCase1(a1, a2, b1, b2, c1, c2);
  checkCase2(a1, a2, 'A', b1, b2, 'B', c1, c2, 'C');
  checkCase2(b1, b2, 'B', a1, a2, 'A', c1, c2, 'C');
  checkCase2(b1, b2, 'B', c1, c2, 'C', a1, a2, 'A');
}
int main() {
  int a1, a2, b1, b2, c1, c2;
  cin >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
  check(a1, a2, b1, b2, c1, c2);
  swap(a1, a2);
  check(a1, a2, b1, b2, c1, c2);
  swap(a1, a2);
  swap(b1, b2);
  check(a1, a2, b1, b2, c1, c2);
  swap(b1, b2);
  swap(c1, c2);
  check(a1, a2, b1, b2, c1, c2);
  swap(c1, c2);
  swap(a1, a2);
  swap(b1, b2);
  check(a1, a2, b1, b2, c1, c2);
  swap(a1, a2);
  swap(b1, b2);
  swap(a1, a2);
  swap(c1, c2);
  check(a1, a2, b1, b2, c1, c2);
  swap(a1, a2);
  swap(c1, c2);
  swap(b1, b2);
  swap(c1, c2);
  check(a1, a2, b1, b2, c1, c2);
  swap(b1, b2);
  swap(c1, c2);
  swap(b1, b2);
  swap(c1, c2);
  swap(a1, a2);
  check(a1, a2, b1, b2, c1, c2);
  printf("-1");
}
