#include <bits/stdc++.h>
using namespace std;
int main() {
  int c[3][3];
  int MAX = -1;
  int pos = -1;
  int area = 0;
  for (int i = 0; i < 3; i++) {
    int a, b;
    cin >> a >> b;
    c[i][0] = min(a, b);
    c[i][1] = max(a, b);
    if (a > MAX) {
      MAX = a;
      pos = i;
    }
    if (b > MAX) {
      MAX = b;
      pos = i;
    }
    area += a * b;
  }
  if (area != MAX * MAX) {
    printf("-1\n");
    return 0;
  } else {
    printf("%d\n", MAX);
    for (int i = 0; i < c[pos][0]; i++) {
      for (int i = 0; i < c[pos][1]; i++) {
        printf("%c", 'A' + pos);
      }
      printf("\n");
    }
    bool ok = false;
    for (int i = 0; i < 3 && !ok; i++) {
      if (i == pos)
        continue;
      else if (c[i][1] == c[pos][1]) {
        for (int j = 0; j < c[i][0]; ++j) {
          for (int k = 0; k < c[i][1]; ++k) {
            printf("%c", 'A' + i);
          }
          printf("\n");
        }
      } else {
        int j2, k2;
        if (c[i][0] + c[pos][0] == c[pos][1]) {
          j2 = c[i][0];
          k2 = c[i][1];
        } else {
          j2 = c[i][1];
          k2 = c[i][0];
        }
        for (int j = 0; j < j2; ++j) {
          int k;
          for (k = 0; k < k2; ++k) {
            printf("%c", 'A' + i);
          }
          for (k; k < MAX; k++) {
            printf("%c", 'A' + (3 - pos - i));
          }
          printf("\n");
          ok = true;
        }
      }
    }
  }
  return 0;
}
