#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int N = (int)1e3 + 7;
int ans[N][N];
int w[N], h[N];
int order[] = {0, 1, 2};
int a;
bool valid(int mask) {
  for (int i = 0; i < a; i++)
    for (int j = 0; j < a; j++) ans[i][j] = -1;
  int w0 = w[order[0]], h0 = h[order[0]];
  if (mask & (1 << 0)) swap(w0, h0);
  int w1 = w[order[1]], h1 = h[order[1]];
  if (mask & (1 << 1)) swap(w1, h1);
  int w2 = w[order[2]], h2 = h[order[2]];
  if (mask & (1 << 2)) swap(w2, h2);
  int x = 0, y = 0;
  for (x = 0; x < w0; x++)
    for (y = 0; y < h0; y++) ans[x][y] = order[0];
  bool flag = true;
  for (int i = 0; i < a && flag; i++) {
    for (int j = 0; j < a && flag; j++) {
      if (ans[i][j] != -1) continue;
      if (i + w1 - 1 >= a || j + h1 - 1 >= a) return false;
      for (int ii = i; ii < i + w1; ii++)
        for (int jj = j; jj < j + h1; jj++) {
          if (ans[ii][jj] != -1) return false;
          ans[ii][jj] = order[1];
          flag = false;
        }
    }
  }
  flag = true;
  for (int i = 0; i < a && flag; i++) {
    for (int j = 0; j < a && flag; j++) {
      if (ans[i][j] != -1) continue;
      if (i + w2 - 1 >= a || j + h2 - 1 >= a) return false;
      for (int ii = i; ii < i + w2; ii++)
        for (int jj = j; jj < j + h2; jj++) {
          if (ans[ii][jj] != -1) return false;
          ans[ii][jj] = order[2];
          flag = false;
        }
    }
  }
  return true;
}
int main() {
  int sum = 0;
  for (int i = 0; i < 3; i++) cin >> w[i] >> h[i], sum += w[i] * h[i];
  for (int i = 1; i <= 200; i++)
    if (i * i == sum) a = i;
  if (!a) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    if (w[i] > a || h[i] > a) {
      cout << -1;
      return 0;
    }
  }
  do {
    for (int mask = 0; mask < (1 << 3); mask++) {
      if (valid(mask)) {
        cout << a << '\n';
        for (int i = 0; i < a; i++) {
          for (int j = 0; j < a; j++) {
            cout << char('A' + ans[i][j]);
          }
          cout << '\n';
        }
        return 0;
      }
    }
  } while (next_permutation(order, order + 3));
  cout << -1;
  return 0;
}
