#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> q[10005];
long long n, i, a[5][5], s, l, k, s2;
int sos[5], b[105][105];
int main() {
  for (i = 0; i < 103; i++)
    for (k = 0; k < 103; k++) b[i][k] = 4;
  for (i = 0; i < 3; i++) {
    cin >> a[i][0] >> a[i][1];
    s += a[i][0] * a[i][1];
  }
  if (sqrt(s) != round(sqrt(s))) {
    cout << "-1";
    return 0;
  }
  n = round(sqrt(s));
  s = 0;
  for (i = 0; i < 3; i++)
    for (k = 0; k < 2; k++)
      if (a[i][k] > n) {
        cout << "-1";
        return 0;
      }
  for (i = 0; i < 3; i++) {
    if ((a[i][0] == n) and (sos[i] == 0)) {
      sos[i] = 1;
      for (l = 0; l < a[i][1]; l++)
        for (k = 0; k < n; k++) b[l + s][k] = i;
      s += a[i][1];
    }
    if ((a[i][1] == n) and (sos[i] == 0)) {
      sos[i] = 1;
      for (l = 0; l < a[i][0]; l++)
        for (k = 0; k < n; k++) b[l + s][k] = i;
      s += a[i][0];
    }
  }
  for (i = 0; i < 3; i++)
    if (sos[i] == 0) {
      if (a[i][0] + s == n) {
        sos[i] = 1;
        for (l = s; l < n; l++)
          for (k = 0; k < a[i][1]; k++) b[l][k + s2] = i;
        s2 = a[i][1];
      }
      if ((a[i][1] + s == n) and (sos[i] == 0)) {
        sos[i] = 1;
        for (l = s; l < n; l++)
          for (k = 0; k < a[i][0]; k++) b[l][k + s2] = i;
        s2 = a[i][0];
      }
    }
  for (i = 0; i < 3; i++)
    if (sos[i] == 0) {
      cout << "-1";
      return 0;
    }
  cout << n << "\n";
  for (i = 0; i < n; i++) {
    for (k = 0; k < n; k++) cout << (char)(b[i][k] + 'A');
    cout << "\n";
  }
  return 0;
}
