#include <bits/stdc++.h>
using namespace std;
int x[305][305], l[3], w[3], N;
bool put[3], possible;
bool check() {
  int maxn = -1, maxm = -1;
  for (int i = 0; i < (int)305; i++)
    for (int j = 0; j < (int)305; j++) {
      if (x[i][j] != -1) maxn = max(maxn, j + 1);
      if (x[j][i] != -1) maxm = max(maxm, j + 1);
    }
  if (maxn != maxm) return false;
  for (int i = 0; i < (int)maxn; i++)
    for (int j = 0; j < (int)maxn; j++)
      if (x[i][j] == -1) return false;
  possible = true;
  N = maxn;
  return true;
}
bool Put(int L, int W, int val, int sl, int sw) {
  int xx, yy;
  for (int i = sl; i < (int)sl + L; i++)
    for (int j = sw; j < (int)sw + W; j++) {
      if (x[i][j] != -1) return false;
      x[i][j] = val;
    }
  return true;
}
void solve() {
  int pos[] = {0, 1, 2};
  do {
    bool fl[3];
    memset(x, -1, sizeof(x));
    fl[0] = Put(l[pos[0]], w[pos[0]], pos[0], 0, 0);
    fl[1] = Put(l[pos[1]], w[pos[1]], pos[1], 0, w[pos[0]]);
    fl[2] = Put(l[pos[2]], w[pos[2]], pos[2], 0, w[pos[0]] + w[pos[1]]);
    if (fl[0] && fl[1] && fl[2]) check();
    if (possible) return;
    memset(x, -1, sizeof(x));
    fl[0] = Put(l[pos[0]], w[pos[0]], pos[0], 0, 0);
    fl[1] = Put(l[pos[1]], w[pos[1]], pos[1], 0, w[pos[0]]);
    fl[2] = Put(l[pos[2]], w[pos[2]], pos[2], l[pos[0]], 0);
    if (fl[0] && fl[1] && fl[2]) check();
    if (possible) return;
    memset(x, -1, sizeof(x));
    fl[0] = Put(l[pos[0]], w[pos[0]], pos[0], 0, 0);
    fl[1] = Put(l[pos[1]], w[pos[1]], pos[1], l[pos[0]], 0);
    fl[2] = Put(l[pos[2]], w[pos[2]], pos[2], l[pos[0]], w[pos[1]]);
    if (fl[0] && fl[1] && fl[2]) check();
    if (possible) return;
  } while (next_permutation(pos, pos + 3));
}
void backtrack(int p) {
  if (possible) return;
  if (p == 3) {
    solve();
    return;
  }
  backtrack(p + 1);
  swap(l[p], w[p]);
  backtrack(p + 1);
  swap(l[p], w[p]);
}
int main() {
  for (int i = 0; i < (int)3; i++) scanf("%d%d", &l[i], &w[i]);
  backtrack(0);
  if (possible == false) {
    puts("-1");
    return 0;
  }
  printf("%d\n", N);
  for (int i = 0; i < (int)N; i++) {
    for (int j = 0; j < (int)N; j++) printf("%c", x[i][j] + 'A');
    puts("");
  }
  return 0;
}
