#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, x2, y2, x3, y3, i, j, k, p;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  int area = x1 * y1 + x2 * y2 + x3 * y3;
  int side = sqrt(area);
  if (side * side == area) {
    int xx[3], yy[3];
    int fo = 0;
    for (p = 0; p < 8; ++p) {
      xx[0] = x1;
      yy[0] = y1;
      xx[1] = x2;
      yy[1] = y2;
      xx[2] = x3;
      yy[2] = y3;
      for (j = 0; j <= 2; ++j) {
        if (p & (1 << j)) swap(xx[j], yy[j]);
      }
      int mat[side + 1][side + 1];
      memset(mat, 0, sizeof(mat));
      for (k = 0; k <= 2; ++k) {
        int fx = -1, fy = -1;
        for (i = 1; i <= side; ++i) {
          for (j = 1; j <= side; ++j) {
            if (mat[i][j] == 0) {
              if ((side - i + 1 >= xx[k]) && (side - j + 1 >= yy[k])) {
                fx = i;
                fy = j;
                break;
              }
            }
          }
          if (fx != -1) break;
        }
        if (fx == -1) break;
        for (i = fx; i <= fx + xx[k] - 1; ++i)
          for (j = fy; j <= fy + yy[k] - 1; ++j) mat[i][j] = k + 1;
      }
      int tmp = 1;
      for (i = 1; i <= side; ++i)
        for (j = 1; j <= side; ++j)
          if (mat[i][j] == 0) {
            tmp = 0;
            break;
          }
      if (tmp) {
        cout << side << endl;
        for (i = 1; i <= side; ++i) {
          for (j = 1; j <= side; ++j) cout << (char)(mat[i][j] + 64);
          cout << endl;
        }
        fo = 1;
      }
      if (fo) break;
    }
    if (fo == 0) cout << "-1\n";
  } else
    cout << "-1\n";
  return 0;
}
