#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
char mat[1000][1000];
void fillRect(long long int x1, long long int x2, long long int y1,
              long long int y2, char a) {
  for (long long int i = x1; i <= x2; i++) {
    for (long long int j = y1; j <= y2; j++) {
      mat[i][j] = a;
    }
  }
}
int main() {
  long long int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  long long int pp = (x1 * y1) + (x2 * y2) + (x3 * y3);
  long long int p = sqrt(pp);
  if (x1 != p && y1 != p && x2 != p && y2 != p && x3 != p && y3 != p) {
    cout << "-1";
    return 0;
  }
  if (p * p != pp) {
    cout << "-1";
    return 0;
  }
  if (x1 == p || y1 == p) {
    fillRect(1, p, 1, x1 * y1 / p, 'A');
    if (x1 != p) {
      long long int temp = x1;
      x1 = y1;
      y1 = temp;
    }
  } else
    fillRect(1, x1, 1, y1, 'A');
  if (p - x1 == x2 || p - x1 == y2) {
    fillRect(x1 + 1, p, 1, x2 * y2 / (p - x1), 'B');
  } else {
    if (p == x2 || p == y2) {
      fillRect(1, p, y1 + 1, y1 + x2 * y2 / p, 'B');
    } else {
      fillRect(1, x2 * y2 / (p - y1), y1 + 1, p, 'B');
    }
  }
  cout << p;
  cout << "\n";
  for (long long int i = 1; i <= p; i++) {
    for (long long int j = 1; j <= p; j++) {
      if (mat[i][j] == 'A' || mat[i][j] == 'B')
        cout << mat[i][j];
      else
        cout << "C";
    }
    cout << "\n";
  }
  return 0;
}
