#include <bits/stdc++.h>
using namespace std;
int S, n, d, a[128], b[128];
bool mark[3];
int p[128][128];
set<pair<int, int> > s;
void End() {
  cout << d << endl;
  for (int i = 0; i < d; cout << endl, i++)
    for (int j = 0; j < d; j++) cout << char('A' + p[i][j]);
  exit(0);
}
void fill(int i, int ii, int j, int jj, int x) {
  for (int k = i; k <= ii; k++)
    for (int l = j; l <= jj; l++) {
      p[k][l] = x;
      if (x != -1)
        s.erase(make_pair(k, l));
      else
        s.insert(make_pair(k, l));
    }
}
bool empty(int i, int ii, int j, int jj) {
  if (ii >= d or jj >= d) return false;
  for (int k = i; k <= ii; k++)
    for (int l = j; l <= jj; l++)
      if (p[k][l] != -1) return false;
  return true;
}
void bt() {
  if (!s.size()) {
    End();
    return;
  }
  int x = s.begin()->first;
  int y = s.begin()->second;
  for (int i = 0; i < 3; i++)
    if (!mark[i]) {
      mark[i] = true;
      if (empty(x, x + a[i] - 1, y, y + b[i] - 1)) {
        fill(x, x + a[i] - 1, y, y + b[i] - 1, i);
        bt();
        fill(x, x + a[i] - 1, y, y + b[i] - 1, -1);
      }
      if (empty(x, x + b[i] - 1, y, y + a[i] - 1)) {
        fill(x, x + b[i] - 1, y, y + a[i] - 1, i);
        bt();
        fill(x, x + b[i] - 1, y, y + a[i] - 1, -1);
      }
      mark[i] = false;
    }
}
int main() {
  for (int i = 0; i < 3; i++) {
    cin >> a[i] >> b[i];
    S += a[i] * b[i];
  }
  d = (int)sqrt(S);
  if (d * d != S) {
    cout << -1 << endl;
    exit(0);
  }
  for (int i = 0; i < d; i++)
    for (int j = 0; j < d; j++) s.insert(make_pair(i, j)), p[i][j] = -1;
  bt();
  cout << -1 << endl;
  return 0;
}
