#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double row;
  bool printA = false, printB = false, printC = false;
  int x1, x2, x3, y1, y2, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  double area = (x1 * y1) + (x2 * y2) + (x3 * y3);
  row = (sqrt(area));
  n = int(row);
  if (((x1 * y1) + (x2 * y2) + (x3 * y3)) != n * n) {
    cout << "-1";
  } else if (x1 != n && y1 != n && x2 != n && y2 != n && x3 != n && y3 != n) {
    cout << "-1";
  } else {
    cout << n << endl;
    if ((x1 * y1) % n == 0) {
      for (int i = 0; i < min(x1, y1); i++) {
        for (int j = 0; j < n; j++) {
          cout << "A";
        }
        cout << endl;
      }
      row -= min(x1, y1);
      printA = true;
    }
    if ((x2 * y2) % n == 0) {
      for (int i = 0; i < min(x2, y2); i++) {
        for (int j = 0; j < n; j++) {
          cout << "B";
        }
        cout << endl;
      }
      printB = true;
      row -= min(x2, y2);
    }
    if ((x3 * y3) % n == 0) {
      for (int i = 0; i < min(x3, y3); i++) {
        for (int j = 0; j < n; j++) {
          cout << "C";
        }
        cout << endl;
      }
      printC = true;
      row -= min(x3, y3);
    }
    for (int i = 0; i < row; i++) {
      if (!printA) {
        for (int j = 0; j < (x1 * y1) / row; j++) {
          cout << "A";
        }
      }
      if (!printB) {
        for (int j = 0; j < (x2 * y2) / row; j++) {
          cout << "B";
        }
      }
      if (!printC) {
        for (int j = 0; j < (x3 * y3) / row; j++) {
          cout << "C";
        }
      }
      cout << endl;
    }
  }
  return 0;
}
