#include <bits/stdc++.h>
using namespace std;
struct rec {
  int x, y;
} rec[5];
int count(int w) {
  int res = 0;
  for (int i = 1; i <= 3; i++) {
    if (rec[i].x == w || rec[i].y == w) res++;
  }
  return res;
}
void print(int i, int w) {
  char c;
  if (i == 1) c = 'A';
  if (i == 2) c = 'B';
  if (i == 3) c = 'C';
  for (int i = 0; i < w; i++) printf("%c", c);
}
int main() {
  int s;
  while (scanf("%d%d", &rec[1].x, &rec[1].y) != EOF) {
    s = 0;
    s += rec[1].x * rec[1].y;
    scanf("%d%d", &rec[2].x, &rec[2].y);
    s += rec[2].x * rec[2].y;
    scanf("%d%d", &rec[3].x, &rec[3].y);
    s += rec[3].x * rec[3].y;
    int w = (int)sqrt(s);
    if (w * w != s) {
      printf("-1\n");
      continue;
    }
    int cntw = count(w);
    if (cntw == 3) {
      printf("%d\n", w);
      for (int i = 1; i <= 3; i++) {
        int h;
        if (rec[i].x != w)
          h = rec[i].x;
        else
          h = rec[i].y;
        for (int j = 0; j < h; j++) {
          print(i, w);
          printf("\n");
        }
      }
    } else if (cntw == 1) {
      for (int i = 1; i <= 3; i++) {
        if (rec[i].x == w || rec[i].y == w) {
          int h;
          if (rec[i].x == w)
            h = w - rec[i].y;
          else
            h = w - rec[i].x;
          int cnth = count(h);
          if (cnth < 2) {
            printf("-1\n");
            break;
          }
          for (int j = 1; j <= 3; j++) {
            int ww;
            if (rec[j].x == h || rec[j].y == h) {
              if (rec[j].x == h)
                ww = rec[j].y;
              else
                ww = rec[j].x;
              if (ww == w) continue;
              if (rec[6 - i - j].x != w - ww && rec[6 - i - j].y != w - ww) {
                printf("-1\n");
                break;
              }
              printf("%d\n", w);
              for (int k = 0; k < w - h; k++) {
                print(i, w);
                printf("\n");
              }
              for (int k = 0; k < h; k++) {
                print(j, ww);
                print(6 - i - j, w - ww);
                printf("\n");
              }
              break;
            }
          }
        }
      }
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
