#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const double eps = 1e-12;
int main() {
  char ch1 = 'A', ch2 = 'B', ch3 = 'C';
  int c1, r1, c2, r2, c3, r3;
  scanf("%d%d%d%d%d%d", &c1, &r1, &c2, &r2, &c3, &r3);
  if (r1 > c1) swap(r1, c1);
  if (r2 > c2) swap(r2, c2);
  if (r3 > c3) swap(r3, c3);
  if (r1 + r2 + r3 == c1 && c1 == c2 && c2 == c3) {
    printf("%d\n", c1);
    for (int i = 0; i < r1; i++) {
      for (int j = 0; j < c1; j++) printf("%c", ch1);
      printf("\n");
    }
    for (int i = 0; i < r2; i++) {
      for (int j = 0; j < c2; j++) printf("%c", ch2);
      printf("\n");
    }
    for (int i = 0; i < r3; i++) {
      for (int j = 0; j < c3; j++) printf("%c", ch3);
      printf("\n");
    }
    return 0;
  }
  if (c1 < c2) {
    swap(r1, r2);
    swap(c1, c2);
    swap(ch1, ch2);
  }
  if (c1 < c3) {
    swap(r1, r3);
    swap(c1, c3);
    swap(ch1, ch3);
  }
  if (c1 == c2 + c3 && c1 == r1 + r2 && r2 == r3) {
    printf("%d\n", c1);
    for (int i = 0; i < r1; i++) {
      for (int j = 0; j < c1; j++) printf("%c", ch1);
      printf("\n");
    }
    for (int i = 0; i < r2; i++) {
      for (int j = 0; j < c2; j++) printf("%c", ch2);
      for (int j = 0; j < c3; j++) printf("%c", ch3);
      printf("\n");
    }
    return 0;
  }
  swap(r2, c2);
  if (c1 == c2 + c3 && c1 == r1 + r2 && r2 == r3) {
    printf("%d\n", c1);
    for (int i = 0; i < r1; i++) {
      for (int j = 0; j < c1; j++) printf("%c", ch1);
      printf("\n");
    }
    for (int i = 0; i < r2; i++) {
      for (int j = 0; j < c2; j++) printf("%c", ch2);
      for (int j = 0; j < c3; j++) printf("%c", ch3);
      printf("\n");
    }
    return 0;
  }
  swap(r2, c2);
  swap(r3, c3);
  if (c1 == c2 + c3 && c1 == r1 + r2 && r2 == r3) {
    printf("%d\n", c1);
    for (int i = 0; i < r1; i++) {
      for (int j = 0; j < c1; j++) printf("%c", ch1);
      printf("\n");
    }
    for (int i = 0; i < r2; i++) {
      for (int j = 0; j < c2; j++) printf("%c", ch2);
      for (int j = 0; j < c3; j++) printf("%c", ch3);
      printf("\n");
    }
    return 0;
  }
  swap(r2, c2);
  if (c1 == c2 + c3 && c1 == r1 + r2 && r2 == r3) {
    printf("%d\n", c1);
    for (int i = 0; i < r1; i++) {
      for (int j = 0; j < c1; j++) printf("%c", ch1);
      printf("\n");
    }
    for (int i = 0; i < r2; i++) {
      for (int j = 0; j < c2; j++) printf("%c", ch2);
      for (int j = 0; j < c3; j++) printf("%c", ch3);
      printf("\n");
    }
    return 0;
  }
  printf("-1");
  return 0;
}
