#include <bits/stdc++.h>
using namespace std;
int dx[] = {+1, -1, 0, 0};
int dy[] = {0, 0, +1, -1};
int dx2[] = {+1, -1, 0, 0, +1, +1, -1, -1};
int dy2[] = {0, 0, +1, -1, +1, -1, -1, +1};
long long squ(long long x) { return (x * x); }
long long power(long long n, long long k) {
  long long N = n;
  for (long long i = 2; i <= k; i++) N *= n;
  return N;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int mx = 0, rm, ar = 0, i, j, sr, ck, n;
  string s;
  for (i = 0; i < 3; i++) s += ('A' + i);
  vector<int> x(3), y(3);
  for (i = 0; i < 3; i++) {
    cin >> x[i] >> y[i];
    ar += (x[i] * y[i]);
  }
  for (i = 1; i <= 200; i++) {
    if (squ(i) == ar) {
      n = i;
      break;
    }
    if (squ(i) > ar) {
      cout << -1;
      return 0;
    }
  }
  vector<int> v;
  for (i = 0; i < 3; i++) {
    if (x[i] == n) {
      swap(x[i], y[i]);
    }
    if (y[i] == n) v.push_back(i);
  }
  if (v.size() == 3) {
    cout << n << endl;
    for (i = 0; i < 3; i++) {
      for (j = 0; j < x[i]; j++) {
        for (rm = 0; rm < y[i]; rm++) cout << s[i];
        cout << endl;
      }
    }
    return 0;
  }
  if (v.size() == 1) {
    int cur = x[v[0]];
    rm = n - cur;
    ck = 0;
    for (i = 0; i < 3; i++) {
      if (i != v[0]) {
        if (y[i] == rm) swap(x[i], y[i]);
        if (x[i] == rm) ck++;
      }
    }
    if (ck == 2) {
      int p1 = (v[0] + 1) % 3;
      int p2 = (p1 + 1) % 3;
      cout << n << endl;
      for (i = 0; i < cur; i++) {
        for (j = 0; j < y[v[0]]; j++) cout << s[v[0]];
        cout << endl;
      }
      for (i = 0; i < rm; i++) {
        for (j = 0; j < y[p1]; j++) cout << s[p1];
        for (j = 0; j < y[p2]; j++) cout << s[p2];
        cout << endl;
      }
    }
    return 0;
  }
  cout << -1;
  return 0;
}
