#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[3], y[3], mx = 0, area = 0;
  for (int i = 0; i < 3; i++) {
    scanf("%d", &x[i]);
    scanf("%d", &y[i]);
    mx = max(mx, x[i]);
    mx = max(mx, y[i]);
    area += x[i] * y[i];
  }
  if (mx * mx != area) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", mx);
  vector<vector<int> > a(mx, vector<int>(mx, 0));
  vector<pair<int, int> > vp;
  for (int i = 0; i < 3; i++) {
    vp.push_back(make_pair(max(x[i], y[i]), min(x[i], y[i])));
  }
  sort(vp.begin(), vp.end());
  reverse(vp.begin(), vp.end());
  for (int i = 0; i < vp[0].first; i++)
    for (int j = 0; j < vp[0].second; j++) a[i][j] = 'A';
  int countA = vp[0].first * vp[0].second, countB = 0, countC = 0;
  if (mx > vp[0].first) {
    if (vp[1].first == mx - vp[0].first)
      for (int i = 0; i < vp[1].first; i++)
        for (int j = 0; j < vp[1].second; j++) a[i + vp[0].first][j] = 'B';
    else if (vp[1].second == mx - vp[0].first)
      for (int i = 0; i < vp[1].second; i++)
        for (int j = 0; j < vp[1].first; j++) a[i + vp[0].first][j] = 'B';
    else if (vp[2].first == mx - vp[0].first)
      for (int i = 0; i < vp[2].first; i++)
        for (int j = 0; j < vp[2].second; j++) a[i + vp[0].first][j] = 'B';
    else if (vp[2].second == mx - vp[0].first)
      for (int i = 0; i < vp[2].second; i++)
        for (int j = 0; j < vp[2].first; j++) a[i + vp[0].first][j] = 'B';
    else if (vp[1].first == mx)
      for (int i = 0; i < vp[1].second; i++)
        for (int j = 0; j < vp[1].first; j++) a[i + vp[0].first][j] = 'B';
    else if (vp[1].second == mx)
      for (int i = 0; i < vp[1].first; i++)
        for (int j = 0; j < vp[1].second; j++) a[i + vp[0].first][j] = 'B';
  } else {
    if (vp[1].second == mx - vp[0].second)
      for (int i = 0; i < vp[1].first; i++)
        for (int j = 0; j < vp[1].second; j++) a[i][j + vp[0].second] = 'B';
    else if (vp[1].first == mx - vp[0].second)
      for (int i = 0; i < vp[1].second; i++)
        for (int j = 0; j < vp[1].first; j++) a[i][j + vp[0].second] = 'B';
    else if (vp[2].second == mx - vp[0].second)
      for (int i = 0; i < vp[2].first; i++)
        for (int j = 0; j < vp[2].second; j++) a[i][j + vp[0].second] = 'B';
    else if (vp[2].first == mx - vp[0].second)
      for (int i = 0; i < vp[2].second; i++)
        for (int j = 0; j < vp[2].first; j++) a[i][j + vp[0].second] = 'B';
    else if (vp[1].second == mx)
      for (int i = 0; i < vp[1].second; i++)
        for (int j = 0; j < vp[1].first; j++) a[i][j + vp[0].second] = 'B';
    else if (vp[1].first == mx)
      for (int i = 0; i < vp[1].first; i++)
        for (int j = 0; j < vp[1].second; j++) a[i][j + vp[0].second] = 'B';
  }
  for (int i = 0; i < mx; i++)
    for (int j = 0; j < mx; j++)
      if (a[i][j] == 'B') countB++;
  countC = mx * mx - countA - countB;
  if (x[0] * y[0] != countA) {
    if (x[0] * y[0] == countB) {
      for (int i = 0; i < mx; i++)
        for (int j = 0; j < mx; j++)
          if (a[i][j] == 'B')
            a[i][j] = 'A';
          else if (a[i][j] == 'A')
            a[i][j] = 'B';
      countB = countA;
    } else {
      for (int i = 0; i < mx; i++)
        for (int j = 0; j < mx; j++)
          if (a[i][j] == 0)
            a[i][j] = 'A';
          else if (a[i][j] == 'A')
            a[i][j] = 0;
      countC = countA;
    }
  }
  if (x[1] * y[1] != countB) {
    for (int i = 0; i < mx; i++)
      for (int j = 0; j < mx; j++)
        if (a[i][j] == 'B')
          a[i][j] = 0;
        else if (a[i][j] == 0)
          a[i][j] = 'B';
  }
  for (int i = 0; i < mx; i++)
    for (int j = 0; j < mx; j++)
      if (a[i][j] == 0) a[i][j] = 'C';
  for (int i = 0; i < mx; i++) {
    for (int j = 0; j < mx; j++) printf("%c", (char)a[i][j]);
    printf("\n");
  }
  return 0;
}
