#include <bits/stdc++.h>
using namespace std;
int main() {
  char z[3];
  z[0] = 'A';
  z[1] = 'B';
  z[2] = 'C';
  int x[3], y[3];
  for (int i = 0; i < 3; i++) cin >> x[i] >> y[i];
  for (int i = 0; i < 3; i++)
    if (x[i] < y[i]) swap(x[i], y[i]);
  if (x[0] == x[1] && x[0] == x[2]) {
    if (y[0] + y[1] + y[2] == x[0]) {
      int n = x[0];
      cout << n << endl;
      for (int i = 0; i < y[0]; i++) {
        for (int j = 0; j < n; j++) cout << 'A';
        cout << endl;
      }
      for (int i = 0; i < y[1]; i++) {
        for (int j = 0; j < n; j++) cout << 'B';
        cout << endl;
      }
      for (int i = 0; i < y[2]; i++) {
        for (int j = 0; j < n; j++) cout << 'C';
        cout << endl;
      }
    } else
      cout << -1;
    return 0;
  }
  if (x[1] > x[0] && x[1] >= x[2]) {
    swap(x[0], x[1]);
    swap(y[0], y[1]);
    swap(z[0], z[1]);
  } else if (x[2] > x[0] && x[2] > x[1]) {
    swap(x[0], x[2]);
    swap(y[0], y[2]);
    swap(z[0], z[2]);
  }
  int n = x[0];
  if (x[1] == x[2] && x[1] + y[0] == n && y[1] + y[2] == n) {
  } else if (y[1] == x[2] && y[1] + y[0] == n && x[1] + y[2] == n) {
    swap(x[1], y[1]);
  } else if (x[1] == y[2] && x[1] + y[0] == n && y[1] + x[2] == n) {
    swap(x[2], y[2]);
  } else if (y[1] == y[2] && y[1] + y[0] == n && x[1] + x[2] == n) {
    swap(x[1], y[1]);
    swap(x[2], y[2]);
  } else {
    cout << -1;
    return 0;
  }
  cout << n << endl;
  for (int i = 0; i < y[0]; i++) {
    for (int j = 0; j < n; j++) cout << z[0];
    cout << endl;
  }
  for (int i = 0; i < x[1]; i++) {
    for (int j = 0; j < n; j++)
      if (j < y[1])
        cout << z[1];
      else
        cout << z[2];
    cout << endl;
  }
  return 0;
}
