#include <bits/stdc++.h>
struct nuqta {
  int x, y;
} a, b, c;
using namespace std;
void shon(nuqta &a) {
  if (a.x < a.y) swap(a.x, a.y);
}
int main() {
  scanf("%i%i%i%i%i%i", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
  shon(a);
  shon(b);
  shon(c);
  int sa = a.x * a.y, sb = b.x * b.y, scanf = c.x * c.y;
  double S = sqrt(sa + sb + scanf);
  int n = floor(S);
  if (S > n) {
    printf("-1");
    return 0;
  }
  string first[100];
  char g = '\n';
  int i = 0, j = 0;
  if (a.x == n)
    for (j += a.y; i < a.y; i++) first[i] = string(n, 'A') + g;
  if (b.x == n) {
    for (; i < b.y + j; i++) first[i] = string(n, 'B') + g;
    j += b.y;
  }
  if (c.x == n) {
    for (; i < c.y + j; i++) first[i] = string(n, 'C') + g;
    j += c.x;
  }
  if (i < n) {
    nuqta x1, x2;
    char d1, d2;
    if (a.x < n) {
      x1 = a;
      d1 = 'A';
    } else if (c.x < n) {
      x1 = c;
      d1 = 'C';
    }
    if (b.x < n) {
      x2 = b;
      d2 = 'B';
    } else if (c.x < n) {
      x2 = c;
      d2 = 'C';
    }
    if (n - i != x1.x) swap(x1.x, x1.y);
    if (n - i != x2.x) swap(x2.x, x2.y);
    if (n - i != x2.x || n - i != x1.x) {
      printf("-1");
      return 0;
    }
    for (; i < n; i++) {
      first[i] = string(x1.y, d1) += string(n - x1.y, d2) + '\n';
    }
  }
  cout << n << endl;
  for (int i = 0; i < n; i++) cout << first[i];
}
