#include <bits/stdc++.h>
using namespace std;
int g[500][500];
void draw(int x1, int y1, int x2, int y2, char ch) {
  int i, j;
  for (i = x1; i <= x2; i++) {
    for (j = y1; j <= y2; j++) {
      g[i][j] = ch;
    }
  }
}
void print(int x) {
  int i, j;
  printf("%d\n", x);
  for (i = 1; i <= x; i++) {
    for (j = 1; j <= x; j++) {
      printf("%c", g[i][j]);
    }
    puts("");
  }
}
bool solve(int x1, int y1, int num1, int x2, int y2, int num2, int x3, int y3,
           int num3) {
  int x = x1, y = y1;
  if (x2 == x3 && x1 == x2) {
    y += y2 + y3;
    if (x == y) {
      draw(1, 1, y1, x1, 'A' + num1);
      draw(y1 + 1, 1, y1 + y2, x1, 'A' + num2);
      draw(y1 + y2 + 1, 1, y, x1, 'A' + num3);
      print(x);
      return 1;
    }
  } else if (x1 == x2 + x3 && y2 == y3) {
    y += y2;
    if (x == y) {
      draw(1, 1, y1, x1, 'A' + num1);
      draw(y1 + 1, 1, y, x2, 'A' + num2);
      draw(y1 + 1, x2 + 1, y, x, 'A' + num3);
      print(x);
      return 1;
    }
  }
  return 0;
}
int main() {
  int x[5][2], y[5][2];
  int i;
  for (i = 0; i < 3; i++)
    scanf("%d%d", &x[i][0], &y[i][0]), x[i][1] = y[i][0], y[i][1] = x[i][0];
  int j, k, a, b, c;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (i == j) continue;
      for (k = 0; k < 3; k++) {
        if (k == j || k == i) continue;
        for (a = 0; a < 2; a++)
          for (b = 0; b < 2; b++)
            for (c = 0; c < 2; c++) {
              if (solve(x[i][a], y[i][a], i, x[j][b], y[j][b], j, x[k][c],
                        y[k][c], k))
                return 0;
            }
      }
    }
  }
  puts("-1");
  return 0;
}
