#include <bits/stdc++.h>
using namespace std;
int rect[5][5], flag;
void output(int n, int x, int xi, int y, int yi, int z, int mnz) {
  printf("%d\n", n);
  if (rect[x][xi] == n) {
    for (int i = 1; i <= rect[x][!xi]; i++) {
      for (int j = 1; j <= n; j++) printf("%c", x - 1 + 'A');
      printf("\n");
    }
    for (int i = 1; i <= rect[y][!yi]; i++) {
      for (int j = 1; j <= n; j++) printf("%c", y - 1 + 'A');
      printf("\n");
    }
    for (int i = 1; i <= mnz; i++) {
      for (int j = 1; j <= n; j++) printf("%c", z - 1 + 'A');
      printf("\n");
    }
  } else {
    for (int i = 1; i <= rect[x][xi]; i++) {
      for (int j = 1; j <= rect[x][!xi]; j++) printf("%c", x - 1 + 'A');
      for (int j = 1; j <= rect[y][!yi]; j++) printf("%c", y - 1 + 'A');
      printf("\n");
    }
    for (int i = 1; i <= mnz; i++) {
      for (int j = 1; j <= n; j++) printf("%c", z - 1 + 'A');
      printf("\n");
    }
  }
}
int main() {
  for (int i = 1; i <= 3; i++) scanf("%d%d", &rect[i][0], &rect[i][1]);
  for (int i = 1; i <= 3; i++)
    for (int ki = 0; ki <= 1; ki++)
      for (int j = i + 1; j <= 3; j++)
        for (int kj = 0; kj <= 1; kj++)
          if (rect[i][ki] == rect[j][kj] && !flag) {
            int x = rect[i][ki];
            int y = rect[i][!ki] + rect[j][!kj];
            if (x > y) swap(x, y);
            for (int z = 1; z <= 3; z++)
              if (z != i && z != j) {
                int mx = max(rect[z][0], rect[z][1]);
                int mn = min(rect[z][0], rect[z][1]);
                if (mn + x == y && y == mx) {
                  output(mx, i, ki, j, kj, z, mn);
                  flag = 1;
                  break;
                }
              }
          }
  if (!flag) printf("-1");
}
