#include <bits/stdc++.h>
using namespace std;
int x, t, r, c, d, e, f, m, n;
vector<int> l;
int main() {
  bool ok = false;
  for (int i = 0; i < 6; i++) {
    cin >> x;
    l.push_back(x);
  }
  t = l[0] * l[1] + l[2] * l[3] + l[4] * l[5];
  r = sqrt(t);
  if (r * r != t)
    cout << -1;
  else if ((l[0] * l[1] == 1 || l[2] * l[3] == 1 || l[4] * l[5] == 1) && t > 4)
    cout << -1;
  else {
    char a[r + 2][r + 2];
    c = 0;
    for (int i = 0; i < 6; i += 2) {
      if (c < l[i]) {
        c = l[i];
        d = l[i + 1];
        e = i;
        f = i + 1;
      }
    }
    for (int i = 1; i < 6; i += 2) {
      if (c < l[i]) {
        c = l[i];
        d = l[i - 1];
        e = i;
        f = i - 1;
      }
    }
    for (int i = 1; i <= r; i++) {
      for (int j = 1; j <= r; j++) {
        a[i][j] = '.';
      }
    }
    l[e] = 0;
    l[f] = 0;
    char b[6] = {'A', 'A', 'B', 'B', 'C', 'C'};
    m = 1;
    n = 1;
    for (int k = 0; k < 3; k++) {
      if (n + d <= r && m + c <= r) swap(c, d);
      if (m + c > r + 1 || n + d > r + 1) swap(c, d);
      if (k != 2)
        for (int i = m; i < m + c; i++) {
          for (int j = n; j < n + d; j++) {
            a[i][j] = b[e];
          }
        }
      else {
        x = 0;
        for (int i = 1; i <= r; i++) {
          for (int j = 1; j <= r; j++) {
            if (a[i][j] == '.') {
              a[i][j] = b[e];
              x++;
            }
          }
        }
        if (x == l[e] * l[e + 1]) ok = true;
        break;
      }
      m = (m + c) % r;
      n = (n + d) % r;
      if (m == 0) m = r;
      if (n == 0) n = r;
      for (int i = 0; i < 6; i += 2) {
        if (l[i] > 0) {
          c = l[i];
          d = l[i + 1];
          if (k != 1) {
            l[i] = 0;
            l[i + 1] = 0;
          }
          e = i;
          break;
        }
      }
    }
    if (ok) {
      cout << r << '\n';
      for (int i = 1; i <= r; i++) {
        for (int j = 1; j <= r; j++) {
          cout << a[i][j];
        }
        cout << '\n';
      }
    } else {
      cout << -1;
    }
  }
  return 0;
}
