#include <bits/stdc++.h>
using namespace std;
bool check(int n, string s[], int x1, int y1, int x2, int y2, int x3, int y3) {
  int i, j, dx, dy;
  bool ok = false;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (ok) break;
  }
  if (!ok || i + x1 - 1 >= n || j + y1 - 1 >= n) return false;
  for (dx = 0; dx < x1; dx++) {
    for (dy = 0; dy < y1; dy++) {
      if (s[i + dx][j + dy] != '.') return false;
      s[i + dx][j + dy] = 'A';
    }
  }
  ok = false;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (ok) break;
  }
  if (!ok || i + x2 - 1 >= n || j + y2 - 1 >= n) return false;
  for (dx = 0; dx < x2; dx++) {
    for (dy = 0; dy < y2; dy++) {
      if (s[i + dx][j + dy] != '.') return false;
      s[i + dx][j + dy] = 'B';
    }
  }
  ok = false;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        ok = true;
        break;
      }
    }
    if (ok) break;
  }
  if (!ok || i + x3 - 1 >= n || j + y3 - 1 >= n) return false;
  for (dx = 0; dx < x3; dx++) {
    for (dy = 0; dy < y3; dy++) {
      if (s[i + dx][j + dy] != '.') return false;
      s[i + dx][j + dy] = 'C';
    }
  }
  cout << n << "\n";
  for (i = 0; i < n; i++) {
    cout << s[i] << "\n";
  }
  return true;
}
int main() {
  int x1, y1, x2, y2, x3, y3, X1, Y1, X2, Y2, X3, Y3, n, k, i, j, l;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  bool ok = false;
  for (n = 1; n * n <= x1 * y1 + x2 * y2 + x3 * y3; n++) {
    if ((n * n) == (x1 * y1 + x2 * y2 + x3 * y3) &&
        (x1 <= n && x2 <= n && x3 <= n && y1 <= n && y2 <= n && y3 <= n)) {
      ok = true;
      break;
    }
  }
  if (!ok) {
    cout << -1 << "\n";
    return 0;
  } else {
    string s[n];
    for (i = 0; i < 8; i++) {
      if (i % 2 == 0) {
        X1 = x1, Y1 = y1;
      } else {
        X1 = y1, Y1 = x1;
      }
      if (i == 2 || i == 3 || i == 6 || i == 7) {
        X2 = y2, Y2 = x2;
      } else {
        X2 = x2, Y2 = y2;
      }
      if (i >= 4) {
        X3 = y3, Y3 = x3;
      } else {
        X3 = x3, Y3 = y3;
      }
      for (k = 0; k < n; k++) {
        s[k] = "";
        for (l = 0; l < n; l++) {
          s[k] += ".";
        }
      }
      ok = check(n, s, X1, Y1, X2, Y2, X3, Y3);
      if (ok) {
        return 0;
      }
    }
    cout << -1 << "\n";
  }
  return 0;
}
