#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
struct Rect {
  int x, y;
  char ch;
};
bool operator<(Rect a, Rect b) { return a.ch < b.ch; }
void print_rows(Rect *rects) {
  printf("%i\n", rects[0].x);
  for (int r = 0; r < 3; r++) {
    for (int y = 0; y < rects[r].y; y++) {
      for (int x = 0; x < rects[r].x; x++) {
        printf("%c", rects[r].ch);
      }
      printf("\n");
    }
  }
}
void print_generic(Rect *rects) {
  printf("%i\n", rects[0].x);
  for (int y = 0; y < rects[0].y; y++) {
    for (int x = 0; x < rects[0].x; x++) {
      printf("%c", rects[0].ch);
    }
    printf("\n");
  }
  for (int y = 0; y < rects[1].y; y++) {
    for (int r = 1; r < 3; r++) {
      for (int x = 0; x < rects[r].x; x++) {
        printf("%c", rects[r].ch);
      }
    }
    printf("\n");
  }
}
int main() {
  int area = 0, d;
  for (int i = 0; i < 3; i++) {
    scanf("%i %i", &x[i], &y[i]);
    area += x[i] * y[i];
  }
  d = sqrt(area);
  if (d * d != area) {
    printf("-1\n");
    return 0;
  }
  for (int inv = 0; inv < 8; inv++) {
    Rect rects[3];
    for (int j = 0; j < 3; j++) {
      rects[j].x = x[j];
      rects[j].y = y[j];
      rects[j].ch = 'A' + j;
      if (inv & (1 << j)) {
        swap(rects[j].x, rects[j].y);
      }
    }
    do {
      if (rects[0].x != d) {
        continue;
      }
      if ((rects[1].x == d) && (rects[2].x == d)) {
        print_rows(rects);
        return 0;
      }
      if ((rects[1].x + rects[2].x == d) && (rects[1].y == rects[2].y)) {
        print_generic(rects);
        return 0;
      }
    } while (next_permutation(rects, rects + 3));
  }
  printf("-1\n");
}
