#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const long long INF = 9 * 1e18;
using namespace std;
void solve() {
  long long l1, l2, l3, b1, b2, b3;
  cin >> l1 >> b1 >> l2 >> b2 >> l3 >> b3;
  if (l1 < b1) swap(l1, b1);
  if (l2 < b2) swap(l2, b2);
  if (l3 < b3) swap(l3, b3);
  vector<vector<long long> > ar = {{l1, b1, 0}, {l2, b2, 1}, {l3, b3, 2}};
  sort(ar.rbegin(), ar.rend());
  double ans = l1 * b1 + l2 * b2 + l3 * b3;
  double hold = sqrt(ans);
  long long n = hold;
  char mat[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) mat[i][j] = (char)('A' + ar[2][2]);
  }
  if (ar[0][0] == hold && ar[1][0] == hold && ar[2][0] == hold) {
    long long sum = ar[0][1] + ar[1][1] + ar[2][1];
    if (sum != hold) {
      cout << -1 << endl;
      return;
    } else {
      cout << n << endl;
      for (int i = 0; i < ar[0][1]; i++) {
        for (int j = 0; j < n; j++) {
          cout << (char)('A' + ar[0][2]);
        }
        cout << endl;
      }
      for (int i = 0; i < ar[1][1]; i++) {
        for (int j = 0; j < n; j++) {
          cout << (char)('A' + ar[1][2]);
        }
        cout << endl;
      }
      for (int i = 0; i < ar[2][1]; i++) {
        for (int j = 0; j < n; j++) {
          cout << (char)('A' + ar[2][2]);
        }
        cout << endl;
      }
      return;
    }
  }
  if (hold * hold != ans || ar[0][0] != hold) {
    cout << -1 << endl;
    return;
  }
  for (int i = 0; i < ar[0][1]; i++) {
    for (int j = 0; j < n; j++) mat[i][j] = (char)('A' + ar[0][2]);
  }
  long long len = n - ar[0][1];
  long long bre = n;
  if (ar[1][0] != len) {
    swap(ar[1][0], ar[1][1]);
  }
  if (ar[2][0] != len) {
    swap(ar[2][0], ar[2][1]);
  }
  if (ar[1][0] != len || ar[2][0] != len) {
    cout << -1 << endl;
    return;
  }
  if (ar[1][1] + ar[2][1] != n) {
    cout << -1 << endl;
    return;
  }
  for (int i = n - 1; i >= n - len; i--) {
    for (int j = 0; j < ar[1][1]; j++) mat[i][j] = (char)('A' + ar[1][2]);
  }
  cout << n << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << mat[i][j];
    }
    cout << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
