#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
char s[3] = {'A', 'B', 'C'};
int main() {
  int x[3], y[3], f, mx = 0, f1, f2;
  scanf("%d%d%d%d%d%d", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2]);
  for (int i = 0; i < 3; i++) {
    if (x[i] < y[i]) {
      swap(x[i], y[i]);
    }
  }
  for (int i = 0; i < 3; i++) {
    if (x[i] > mx) {
      f = i;
      mx = x[i];
    }
  }
  for (f1 = 0; f1 < 3; f1++) {
    if (f1 != f) {
      break;
    }
  }
  for (f2 = 0; f2 < 3; f2++) {
    if (f2 != f1 && f2 != f) {
      break;
    }
  }
  if (x[f1] == y[f2] && y[f1] + x[f2] == x[f] && x[f1] + y[f] == x[f]) {
    swap(y[f2], x[f2]);
  } else if (x[f2] == y[f1] && y[f2] + x[f1] == x[f] && x[f2] + y[f] == x[f]) {
    swap(y[f1], x[f1]);
  } else if (y[f1] == y[f2] && x[f2] + x[f1] == x[f] && y[f1] + y[f] == x[f]) {
    swap(y[f1], x[f1]);
    swap(y[f2], x[f2]);
  }
  if (x[f1] == x[f2] && y[f1] + y[f2] == x[f] && x[f1] + y[f] == x[f]) {
    printf("%d\n", x[f]);
    for (int i = 0; i < x[f1]; i++) {
      for (int j = 0; j < y[f1]; j++) {
        printf("%c", s[f1]);
      }
      for (int j = 0; j < y[f2]; j++) {
        printf("%c", s[f2]);
      }
      printf("\n");
    }
    for (int i = 0; i < y[f]; i++) {
      for (int j = 0; j < x[f]; j++) {
        printf("%c", s[f]);
      }
      printf("\n");
    }
  } else if (x[f] == x[f2] && x[f1] == x[f2] && x[f] == x[f1] &&
             y[f] + y[f1] + y[f2] == x[f]) {
    printf("%d\n", x[f]);
    for (int i = 0; i < y[0]; i++) {
      for (int j = 0; j < x[f]; j++) {
        printf("A");
      }
      printf("\n");
    }
    for (int i = 0; i < y[1]; i++) {
      for (int j = 0; j < x[f]; j++) {
        printf("B");
      }
      printf("\n");
    }
    for (int i = 0; i < y[2]; i++) {
      for (int j = 0; j < x[f]; j++) {
        printf("C");
      }
      printf("\n");
    }
  } else
    printf("-1\n");
}
