#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10;
pair<int, int> v[MAXN];
pair<pair<int, int>, int> aux[MAXN];
int sqrtv;
char grid[305][305];
void f() {
  memset(grid, '*', sizeof(grid));
  for (int p = 0; p < (3); ++p) {
    int x = aux[p].first.first;
    int y = aux[p].first.second;
    char c = aux[p].second + 'A';
    bool found = false;
    for (int i = 0; i < (sqrtv); ++i) {
      for (int j = 0; j < (sqrtv); ++j)
        if (grid[i][j] == '*') {
          int remx = sqrtv - i;
          int remy = sqrtv - j;
          if (remx < x || remy < y) return;
          found = true;
          for (int k = 0; k < (x); ++k)
            for (int l = 0; l < (y); ++l) grid[i + k][j + l] = c;
          break;
        }
      if (found) break;
    }
    if (!found) return;
  }
  for (int i = 0; i < (sqrtv); ++i)
    for (int j = 0; j < (sqrtv); ++j)
      if (grid[i][j] == '*') return;
  cout << sqrtv << endl;
  for (int i = 0; i < (sqrtv); ++i) {
    for (int j = 0; j < (sqrtv); ++j) cout << grid[i][j];
    cout << endl;
  }
  exit(0);
}
int main() {
  int n = 3, sum = 0;
  for (int i = 0; i < (n); ++i) {
    cin >> v[i].first >> v[i].second;
    sum += v[i].first * v[i].second;
  }
  sqrtv = round(sqrt(sum));
  if (sqrtv * sqrtv == sum) {
    vector<int> perm = {0, 1, 2};
    while (true) {
      for (int i = 0; i < (8); ++i) {
        for (int j = 0; j < (3); ++j) {
          aux[j] = {v[perm[j]], perm[j]};
          if (i & (1 << j)) swap(aux[j].first.first, aux[j].first.second);
        }
        f();
      }
      if (!next_permutation((perm).begin(), (perm).end())) break;
    }
  }
  cout << -1 << endl;
  return 0;
}
