#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int Sqrt(int n) {
  int i;
  for (i = 0; i * i <= n; ++i) 1;
  return max(0, i - 1);
}
bool Fill(vector<vector<int> >& v, int x, int y, int l, int r, char Ch) {
  for (int i = x; i < x + l; ++i)
    for (int j = y; j < y + r; ++j) {
      if (v[i][j] != 0) return 0;
      v[i][j] = Ch;
    }
  return 1;
}
int dfs(vector<vector<int> >& v) {
  int mx, my, Mx, My;
  mx = my = MOD;
  My = Mx = -1;
  for (int i = 0; i < (v.size()); ++i)
    for (int j = 0; j < (v.size()); ++j) {
      if (v[i][j] == 0) {
        mx = min(mx, i);
        Mx = max(Mx, i);
        my = min(my, j);
        My = max(My, j);
      }
    }
  return (Mx - mx + 1) * (My - my + 1);
}
int main() {
  vector<std::pair<int, int> > inp(3);
  int ar = 0;
  for (int i = 0; i < (3); ++i) {
    cin >> inp[i].first >> inp[i].second;
    ar += inp[i].first * inp[i].second;
  }
  int n = Sqrt(ar);
  if (n * n != ar) {
    cout << -1 << endl;
    return 0;
  }
  vector<vector<int> > v(n, vector<int>(n));
  for (int i = 0; i < 3; ++i)
    for (int j = i + 1; j < 3; ++j) {
      for (int f1 = 0; f1 < 2; ++f1) {
        for (int f2 = 0; f2 < 2; ++f2) {
          for (int ii = 0; ii < (n); ++ii)
            for (int jj = 0; jj < (n); ++jj) v[ii][jj] = 0;
          bool f = true;
          f &= Fill(v, 0, 0, f1 ? inp[i].second : inp[i].first,
                    f1 ? inp[i].first : inp[i].second, i + 'A');
          int l = (f2 ? inp[j].second : inp[j].first);
          int r = (f2 ? inp[j].first : inp[j].second);
          f &= Fill(v, n - l, n - r, l, r, j + 'A');
          f &= (dfs(v) == inp[3 - i - j].first * inp[3 - i - j].second);
          if (f) {
            for (int ii = 0; ii < (n); ++ii)
              for (int jj = 0; jj < (n); ++jj)
                if (v[ii][jj] == 0) v[ii][jj] = (3 - i - j + 'A');
            cout << n << endl;
            for (int i = 0; i < (n); ++i) {
              for (int j = 0; j < (n); ++j) printf("%c", v[i][j]);
              putchar(10);
            }
            return 0;
          }
        }
      }
    }
  cout << -1 << endl;
  return 0;
}
