#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
bool ind;
int x1, x2, x3, y4, y2, y3;
void rec(int i, int j, int k) {
  int a1, a2, a3, b1, b2, b3;
  a1 = x1;
  a2 = x2;
  a3 = x3;
  b1 = y4;
  b2 = y2;
  b3 = y3;
  if (i) swap(a1, b1);
  if (j) swap(a2, b2);
  if (k) swap(a3, b3);
  if (a1 + a2 + a3 == b1 && b1 == b2 && b2 == b3) {
    ind = true;
    cout << b1 << endl;
    for (int q = 1; q <= a1; q++) {
      for (int w = 1; w <= b1; w++) cout << "A";
      cout << endl;
    }
    for (int q = 1; q <= a2; q++) {
      for (int w = 1; w <= b1; w++) cout << "B";
      cout << endl;
    }
    for (int q = 1; q <= a3; q++) {
      for (int w = 1; w <= b1; w++) cout << "C";
      cout << endl;
    }
    return;
  }
  if ((b1 + b2 == b3) && (a1 == a2) && (a1 + a3 == b3)) {
    cout << b3 << endl;
    for (int q = 1; q <= a1; q++) {
      for (int w = 1; w <= b1; w++) cout << "A";
      for (int w = 1; w <= b2; w++) cout << "B";
      cout << endl;
    }
    for (int q = 1; q <= a3; q++) {
      for (int w = 1; w <= b3; w++) cout << "C";
      cout << endl;
    }
    ind = true;
    return;
  }
  if ((b1 + b3 == b2) && (a1 == a3) && (a1 + a2 == b2)) {
    cout << b2 << endl;
    for (int q = 1; q <= a1; q++) {
      for (int w = 1; w <= b1; w++) cout << "A";
      for (int w = 1; w <= b3; w++) cout << "C";
      cout << endl;
    }
    for (int q = 1; q <= a2; q++) {
      for (int w = 1; w <= b2; w++) cout << "B";
      cout << endl;
    }
    ind = true;
    return;
  }
  if ((b3 + b2 == b1) && (a3 == a2) && (a1 + a3 == b1)) {
    cout << b1 << endl;
    for (int q = 1; q <= a2; q++) {
      for (int w = 1; w <= b2; w++) cout << "B";
      for (int w = 1; w <= b3; w++) cout << "C";
      cout << endl;
    }
    for (int q = 1; q <= a1; q++) {
      for (int w = 1; w <= b1; w++) cout << "A";
      cout << endl;
    }
    ind = true;
    return;
  }
}
int main() {
  cin >> x1 >> y4 >> x2 >> y2 >> x3 >> y3;
  ind = false;
  for (int i = 0; i <= 1; i++) {
    for (int j = 0; j <= 1; j++) {
      for (int k = 0; k <= 1; k++) {
        if (ind) break;
        rec(i, j, k);
      }
    }
  }
  if (!ind) cout << -1 << endl;
  return 0;
}
