#include <bits/stdc++.h>
using namespace std;
int xx[3], yy[3], n, tot[3], sum = 0;
int board[202][202];
int ans[202][202];
int cnt = 0;
int mnx, mxx, mny, mxy;
void init() {
  mnx = mny = 2e9;
  mxx = mxy = -2e9;
  cnt = 0;
  memset(board, 0, sizeof(board));
}
bool paint(int sy, int sx, int ly, int lx, int num) {
  for (int i = sy; i < sy + ly; i++) {
    for (int j = sx; j < sx + lx; j++) {
      if (board[i][j]) return false;
      board[i][j] = num;
    }
  }
  return true;
}
int dy[4] = {0, 0, 1, -1};
int dx[4] = {1, -1, 0, 0};
bool isCan(int y, int x) {
  if (y >= 0 && x >= 0 && y < n && x < n && board[y][x] == 0) return true;
  return false;
}
void dfs(int y, int x, int num) {
  cnt++;
  mnx = min(mnx, x);
  mxx = max(mxx, x);
  mny = min(mny, y);
  mxy = max(mxy, y);
  board[y][x] = num;
  for (int k = 0; k < 4; k++) {
    int ny = y + dy[k];
    int nx = x + dx[k];
    if (isCan(ny, nx)) dfs(ny, nx, num);
  }
}
void output() {
  cout << n << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cout << (char)(board[i][j] + 'A' - 1);
    }
    cout << endl;
  }
  exit(0);
}
bool can() {
  vector<int> ord = {0, 1, 2};
  do {
    int w1, h1, w2, h2, w3, h3;
    for (int i = 0; i < 2; i++) {
      if (i == 0) w1 = xx[ord[0]], h1 = yy[ord[0]];
      if (i == 1) w1 = yy[ord[0]], h1 = xx[ord[0]];
      for (int j = 0; j < 2; j++) {
        if (j == 0) w2 = xx[ord[1]], h2 = yy[ord[1]];
        if (j == 1) w2 = yy[ord[1]], h2 = xx[ord[1]];
        for (int k = 0; k < 2; k++) {
          if (k == 0) w3 = xx[ord[2]], h3 = yy[ord[2]];
          if (k == 1) w3 = yy[ord[2]], h3 = xx[ord[2]];
          int can = 1;
          init();
          if (i == 1 && j == 0 && k == 1) {
            int abc = 3;
          }
          can &= paint(0, 0, w1, h1, ord[0] + 1);
          can &= paint(n - w2, n - h2, w2, h2, ord[1] + 1);
          if (!can) continue;
          for (int t = 0; t < n; t++)
            for (int c = 0; c < n; c++) {
              if (!board[t][c]) dfs(t, c, ord[2] + 1);
            }
          if (cnt == xx[ord[2]] * yy[ord[2]] &&
              (mxx - mnx + 1) * (mxy - mny + 1) == cnt) {
            output();
          }
        }
      }
    }
  } while (next_permutation(ord.begin(), ord.end()));
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> xx[0] >> yy[0] >> xx[1] >> yy[1] >> xx[2] >> yy[2];
  for (int i = 0; i < 3; i++) {
    tot[i] = xx[i] * yy[i];
    sum += tot[i];
  }
  n = -1;
  for (int i = 1; i <= 300; i++) {
    if (i * i == sum) {
      n = i;
      break;
    }
  }
  if (n == -1) {
    cout << -1;
    exit(0);
  }
  for (int i = 0; i < 3; i++) {
    if (max(xx[i], yy[i]) > n) {
      cout << -1;
      exit(0);
    }
  }
  can();
  cout << -1;
  return 0;
}
