#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 6;
const int mod = 10007;
const int inf = 0x7f7f7f7f;
const double eps = 1e-4;
inline int scan() {
  long long m = 0, f = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') m = m * 10 + c - '0', c = getchar();
  return int(m * f);
}
int N, K;
struct node {
  int a, b, c;
};
int x[5], y[5];
bool ok1(int a) {
  if (a == y[2]) swap(x[2], y[2]);
  if (a != x[2]) return 0;
  if (a == y[3]) swap(x[3], y[3]);
  if (a != x[3]) return 0;
  return 1;
}
void work1() {
  if (ok1(x[1]) && x[1] == y[1] + y[2] + y[3]) {
    printf("%d\n", y[1] + y[2] + y[3]);
    for (int i = 0; i < y[1]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('A');
      putchar('\n');
    }
    for (int i = 0; i < y[2]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('B');
      putchar('\n');
    }
    for (int i = 0; i < y[3]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('C');
      putchar('\n');
    }
    exit(0);
  }
  swap(x[1], y[1]);
  if (ok1(x[1]) && x[1] == y[1] + y[2] + y[3]) {
    printf("%d\n", y[1] + y[2] + y[3]);
    for (int i = 0; i < y[1]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('A');
      putchar('\n');
    }
    for (int i = 0; i < y[2]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('B');
      putchar('\n');
    }
    for (int i = 0; i < y[3]; i++) {
      for (int j = 0; j < x[1]; j++) putchar('C');
      putchar('\n');
    }
    exit(0);
  }
}
bool okA(int a, int n1, int n2, int n3) {
  if (x[n2] == x[n3] && y[n2] + y[n3] == a && a == x[n2] + y[n1]) {
    return 1;
  }
  if (y[n2] == y[n3] && x[n2] + x[n3] == a && a == y[n2] + y[n1]) {
    swap(x[n2], y[n2]);
    swap(x[n3], y[n3]);
    return 1;
  }
  swap(x[n2], y[n2]);
  if (x[n2] == x[n3] && y[n2] + y[n3] == a && a == x[n2] + y[n1]) {
    return 1;
  }
  if (y[n2] == y[n3] && x[n2] + x[n3] == a && a == y[n2] + y[n1]) {
    swap(x[n2], y[n2]);
    swap(x[n3], y[n3]);
    return 1;
  }
  return 0;
}
void workA(int n1, int n2, int n3) {
  if (okA(x[n1], n1, n2, n3)) {
    printf("%d\n", y[n1] + x[n2]);
    for (int i = 0; i < y[n1]; i++) {
      for (int j = 0; j < x[n1]; j++) putchar('A' + n1 - 1);
      putchar('\n');
    }
    for (int i = 0; i < x[n2]; i++) {
      for (int j = 0; j < y[n2]; j++) putchar('A' + n2 - 1);
      for (int j = 0; j < y[n3]; j++) putchar('A' + n3 - 1);
      putchar('\n');
    }
    exit(0);
  }
  swap(x[n1], y[n1]);
  if (okA(x[n1], n1, n2, n3)) {
    printf("%d\n", y[n1] + x[n2]);
    for (int i = 0; i < y[n1]; i++) {
      for (int j = 0; j < x[n1]; j++) putchar('A' + n1 - 1);
      putchar('\n');
    }
    for (int i = 0; i < x[n2]; i++) {
      for (int j = 0; j < y[n2]; j++) putchar('A' + n2 - 1);
      for (int j = 0; j < y[n3]; j++) putchar('A' + n3 - 1);
      putchar('\n');
    }
    exit(0);
  }
}
int main() {
  cin >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
  work1();
  workA(1, 2, 3);
  workA(2, 1, 3);
  workA(3, 2, 1);
  puts("-1");
  return 0;
}
