#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int main() {
  int a[2], b[2], c[2];
  cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1];
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) {
        if (a[i] == b[j] and a[i] == c[k] and
            (a[i ^ 1] + b[j ^ 1] + c[k ^ 1]) == a[i]) {
          printf("%d\n", a[i]);
          char ch = 'A';
          for (int p = 0; p < a[i ^ 1]; p++, puts(""))
            for (int q = 0; q < a[i]; q++) putchar(ch);
          ch++;
          for (int p = 0; p < b[j ^ 1]; p++, puts(""))
            for (int q = 0; q < a[i]; q++) putchar(ch);
          ch++;
          for (int p = 0; p < c[k ^ 1]; p++, puts(""))
            for (int q = 0; q < a[i]; q++) putchar(ch);
          return 0;
        }
        if (a[i] == b[j] + c[k] and b[j ^ 1] == c[k ^ 1] and
            a[i] == a[i ^ 1] + b[j ^ 1]) {
          printf("%d\n", a[i]);
          char ch = 'A';
          for (int p = 0; p < a[i ^ 1]; p++, puts(""))
            for (int q = 0; q < a[i]; q++) putchar(ch);
          ch++;
          for (int p = 0; p < b[j ^ 1]; p++, puts("")) {
            for (int q = 0; q < b[j]; q++) putchar(ch);
            ch++;
            for (int q = 0; q < c[k]; q++) putchar(ch);
            ch--;
          }
          return 0;
        }
        if (b[j] == a[i] + c[k] and a[i ^ 1] == c[k ^ 1] and
            b[j] == b[j ^ 1] + a[i ^ 1]) {
          printf("%d\n", b[j]);
          char ch = 'B';
          for (int p = 0; p < b[j ^ 1]; p++, puts(""))
            for (int q = 0; q < b[j]; q++) putchar(ch);
          ch--;
          for (int p = 0; p < a[i ^ 1]; p++, puts("")) {
            for (int q = 0; q < a[i]; q++) putchar(ch);
            ch += 2;
            for (int q = 0; q < c[k]; q++) putchar(ch);
            ch -= 2;
          }
          return 0;
        }
        if (c[k] == b[j] + a[i] and b[j ^ 1] == a[i ^ 1] and
            c[k] == c[k ^ 1] + b[j ^ 1]) {
          printf("%d\n", c[k]);
          char ch = 'C';
          for (int p = 0; p < c[k ^ 1]; p++, puts(""))
            for (int q = 0; q < c[k]; q++) putchar(ch);
          ch--;
          for (int p = 0; p < b[j ^ 1]; p++, puts("")) {
            for (int q = 0; q < b[j]; q++) putchar(ch);
            ch--;
            for (int q = 0; q < a[i]; q++) putchar(ch);
            ch++;
          }
          return 0;
        }
      }
  puts("-1");
  return 0;
}
