#include <bits/stdc++.h>
using namespace std;
int n, s, m, x[3], y[3], a[3];
char matr[505][505];
inline void Fill() {
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      matr[i][j] = '#';
    }
  }
}
inline void check() {
  Fill();
  for (int it = 0; it < n; it++) {
    int num = a[it];
    for (int i = 1; i + x[num] - 1 <= m; i++) {
      for (int j = 1; j + y[num] - 1 <= m; j++) {
        if (matr[i][j] == '#') {
          for (int ii = i; ii <= i + x[num] - 1; ii++) {
            for (int jj = j; jj <= j + y[num] - 1; jj++) {
              matr[ii][jj] = char('A' + num);
            }
          }
          goto to;
        }
      }
    }
    return;
  to:;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      if (matr[i][j] == '#') {
        return;
      }
    }
  }
  cout << m << "\n";
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      cout << matr[i][j];
    }
    cout << "\n";
  }
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  n = 3;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    s += x[i] * y[i];
    a[i] = i;
  }
  m = (int)sqrt(s);
  if (m * m != s) {
    return cout << "-1", 0;
  }
  do {
    for (int i = 0; i < (1 << n); i++) {
      for (int j = 0; j < n; j++) {
        if ((i >> j) & 1) {
          swap(x[j], y[j]);
        }
      }
      check();
      for (int j = 0; j < n; j++) {
        if ((i >> j) & 1) {
          swap(x[j], y[j]);
        }
      }
    }
  } while (next_permutation(a, a + n));
  cout << "-1";
}
