#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
int sd;
char ar[400][400];
vector<char> c;
bool check(int x1, int y1, int x2, int y2, int x3, int y3) {
  if (x1 + x2 == sd and y2 == sd and x3 == x1 and y3 == sd - y1) {
    for (int i = 0; i < y1; ++i)
      for (int j = 0; j < x1; ++j) ar[i][j] = c[0];
    for (int i = 0; i < sd; ++i)
      for (int j = x1; j < sd; ++j) ar[i][j] = c[1];
    for (int i = y1; i < sd; ++i)
      for (int j = 0; j < x3; ++j) ar[i][j] = c[2];
    return true;
  }
  if (y1 + y2 + y3 == sd and x1 == sd and x2 == sd and x3 == sd) {
    for (int i = 0; i < y1; ++i)
      for (int j = 0; j < sd; ++j) ar[i][j] = c[0];
    for (int i = y1; i < y1 + y2; ++i)
      for (int j = 0; j < sd; ++j) ar[i][j] = c[1];
    for (int i = y1 + y2; i < sd; ++i)
      for (int j = 0; j < sd; ++j) ar[i][j] = c[2];
    return true;
  }
  return false;
}
int main() {
  cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
  int area = x[0] * y[0] + x[1] * y[1] + x[2] * y[2];
  double side = sqrt(area);
  double temp;
  if (modf(side, &temp)) {
    cout << -1;
    return 0;
  }
  sd = side;
  vector<int> v;
  v.resize(3);
  for (int i = 0; i < 3; ++i) v[i] = i;
  c.resize(3);
  for (int i = 0; i < 3; ++i) c[i] = 'A' + i;
  do {
    for (int mask = 0; mask < 8; ++mask) {
      for (int i = 0; i < 3; ++i)
        if ((mask >> i) & 1) swap(x[i], y[i]);
      if (check(x[v[0]], y[v[0]], x[v[1]], y[v[1]], x[v[2]], y[v[2]])) {
        cout << sd << '\n';
        for (int i = 0; i < sd; ++i) {
          for (int j = 0; j < sd; ++j) cout << ar[i][j];
          cout << '\n';
        }
        return 0;
      }
      for (int i = 0; i < 3; ++i)
        if ((mask >> i) & 1) swap(x[i], y[i]);
    }
  } while (next_permutation(c.begin(), c.end()),
           next_permutation(v.begin(), v.end()));
  cout << -1;
  return 0;
}
