#include <bits/stdc++.h>
int x[5], y[5];
int board[200][200];
int l;
int fac[7][4];
void dfs(int it, int jt) {
  if (jt == 4) {
    printf("%d\n", l);
    for (int i = 1; i <= l; i++) {
      for (int j = 1; j <= l; j++) {
        if (board[i][j] == 1) printf("A");
        if (board[i][j] == 2) printf("B");
        if (board[i][j] == 3) printf("C");
      }
      printf("\n");
    }
    exit(0);
  }
  int sw = 0;
  for (int i = 1; i <= l; i++) {
    for (int j = 1; j <= l; j++) {
      if (board[i][j]) continue;
      int xx = x[fac[it][jt]];
      int yy = y[fac[it][jt]];
      if (i + xx - 1 <= l && j + yy - 1 <= l) {
        sw = 0;
        for (int ii = i; ii <= i + xx - 1; ii++)
          for (int jj = j; jj <= j + yy - 1; jj++) {
            if (board[ii][jj]) sw = 1;
          }
        if (!sw) {
          for (int ii = i; ii <= i + xx - 1; ii++)
            for (int jj = j; jj <= j + yy - 1; jj++)
              board[ii][jj] = fac[it][jt];
          dfs(it, jt + 1);
          for (int ii = i; ii <= i + xx - 1; ii++)
            for (int jj = j; jj <= j + yy - 1; jj++) board[ii][jj] = 0;
        }
      }
      if (i + yy - 1 <= l && j + xx - 1 <= l) {
        sw = 0;
        for (int ii = i; ii <= i + yy - 1; ii++)
          for (int jj = j; jj <= j + xx - 1; jj++) {
            if (board[ii][jj]) sw = 1;
          }
        if (!sw) {
          for (int ii = i; ii <= i + yy - 1; ii++)
            for (int jj = j; jj <= j + xx - 1; jj++)
              board[ii][jj] = fac[it][jt];
          dfs(it, jt + 1);
          for (int ii = i; ii <= i + yy - 1; ii++)
            for (int jj = j; jj <= j + xx - 1; jj++) board[ii][jj] = 0;
        }
      }
      return;
    }
  }
}
int main() {
  scanf("%d%d%d%d%d%d", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]);
  double area = x[1] * y[1] + x[2] * y[2] + x[3] * y[3];
  double len = sqrt(area);
  if (len != (int)len) {
    printf("-1");
    return 0;
  }
  l = (int)len;
  fac[1][1] = 1;
  fac[1][2] = 2;
  fac[1][3] = 3;
  fac[2][1] = 1;
  fac[2][2] = 3;
  fac[2][3] = 2;
  fac[3][1] = 2;
  fac[3][2] = 1;
  fac[3][3] = 3;
  fac[4][1] = 2;
  fac[4][2] = 3;
  fac[4][3] = 1;
  fac[5][1] = 3;
  fac[5][2] = 1;
  fac[5][3] = 2;
  fac[6][1] = 3;
  fac[6][2] = 2;
  fac[6][3] = 1;
  for (int i = 1; i <= 6; i++) dfs(i, 1);
  printf("-1");
  return 0;
}
