#include <bits/stdc++.h>
using namespace std;
const int maxlongint = 2147483647;
const int inf = 1000000000;
int main() {
  int a, b, c, d, e, f, ans = 0, k = -1, n1, n2;
  cin >> a >> b >> c >> d >> e >> f;
  ans = a * b + c * d + e * f;
  for (n1 = 1; n1 <= 1000; n1++)
    if (n1 * n1 == ans) {
      k = n1;
      break;
    }
  if (k == -1) {
    cout << -1 << endl;
    return 0;
  }
  if (b == k) swap(a, b);
  if (d == k) swap(c, d);
  if (f == k) swap(e, f);
  if (a == k && c == k && e == k) {
    cout << k << endl;
    for (n1 = 1; n1 <= b; n1++) {
      for (n2 = 1; n2 <= k; n2++) putchar('A');
      printf("\n");
    }
    for (n1 = 1; n1 <= d; n1++) {
      for (n2 = 1; n2 <= k; n2++) putchar('B');
      printf("\n");
    }
    for (n1 = 1; n1 <= f; n1++) {
      for (n2 = 1; n2 <= k; n2++) putchar('C');
      printf("\n");
    }
    return 0;
  }
  int sd = 0;
  if (c == k) {
    sd = 1;
    swap(a, c);
    swap(b, d);
  } else if (e == k) {
    sd = 2;
    swap(a, e);
    swap(b, f);
  }
  if (a != k) {
    cout << -1 << endl;
    return 0;
  }
  if (d == k - b) swap(c, d);
  if (f == k - b) swap(e, f);
  if (c != k - b || e != k - b) {
    cout << -1 << endl;
    return 0;
  }
  {
    cout << k << endl;
    for (n1 = 1; n1 <= b; n1++) {
      for (n2 = 1; n2 <= k; n2++) putchar('A' + sd);
      printf("\n");
    }
    for (n1 = 1; n1 <= k - b; n1++) {
      if (sd != 1)
        for (n2 = 1; n2 <= d; n2++) putchar('B');
      else
        for (n2 = 1; n2 <= d; n2++) putchar('A');
      if (sd != 2)
        for (n2 = 1; n2 <= f; n2++) putchar('C');
      else
        for (n2 = 1; n2 <= f; n2++) putchar('A');
      printf("\n");
    }
    return 0;
  }
}
