#include <bits/stdc++.h>
using namespace std;
int main() {
  int X[3], Y[3];
  map<string, int> dic_x, dic_y;
  for (int i = 0; i < 3; i++) cin >> X[i] >> Y[i];
  vector<string> ABC(3);
  ABC[0] = "A";
  dic_x["A"] = X[0];
  dic_y["A"] = Y[0];
  ABC[1] = "B";
  dic_x["B"] = X[1];
  dic_y["B"] = Y[1];
  ABC[2] = "C";
  dic_x["C"] = X[2];
  dic_y["C"] = Y[2];
  do {
    int x[3], y[3];
    for (int i = 0; i < 8; i++) {
      int bit = i;
      for (int j = 0; j < 3; j++) {
        if (bit % 2) {
          x[j] = dic_x[ABC[j]];
          y[j] = dic_y[ABC[j]];
          ;
        } else {
          x[j] = dic_y[ABC[j]];
          ;
          y[j] = dic_x[ABC[j]];
        }
        bit /= 2;
      }
      if (x[0] == y[0] + y[1] + y[2] && x[0] == x[1] && x[1] == x[2]) {
        cout << x[0] << endl;
        for (int c = 0; c < 3; c++) {
          for (int i = 0; i < y[c]; i++) {
            for (int j = 0; j < x[c]; j++) cout << ABC[c];
            cout << endl;
          }
        }
        return 0;
      }
      if (x[0] == y[0] + y[1] && x[0] == x[1] + x[2] && y[1] == y[2]) {
        cout << x[0] << endl;
        for (int i = 0; i < y[0]; i++) {
          for (int j = 0; j < x[0]; j++) cout << ABC[0];
          cout << endl;
        }
        for (int i = 0; i < y[1]; i++) {
          for (int j = 0; j < x[1]; j++) cout << ABC[1];
          for (int j = 0; j < x[2]; j++) cout << ABC[2];
          cout << endl;
        }
        return 0;
      }
    }
  } while (next_permutation(ABC.begin(), ABC.end()));
  cout << -1 << endl;
  return 0;
}
