#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, x2, y2, x3, y3;
  scanf("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &x3, &y3);
  if (x1 < y1) swap(x1, y1);
  if (x2 < y2) swap(x2, y2);
  if (x3 < y3) swap(x3, y3);
  int L = max(max(x1, x2), x3);
  if ((x1 * y1 + x2 * y2 + x3 * y3) != L * L) {
    printf("-1\n");
    return 0;
  }
  if (x1 == L && x2 == L && x3 == L) {
    printf("%d\n", L);
    for (int i = 1; i <= y1; i++) {
      for (int j = 1; j <= x1; j++) {
        printf("A");
      }
      printf("\n");
    }
    for (int i = 1; i <= y2; i++) {
      for (int j = 1; j <= x2; j++) {
        printf("B");
      }
      printf("\n");
    }
    for (int i = 1; i <= y3; i++) {
      for (int j = 1; j <= x3; j++) {
        printf("C");
      }
      printf("\n");
    }
  } else if (x1 == L) {
    if (x2 == L - y1) swap(x2, y2);
    if (x3 == L - y1) swap(x3, y3);
    if (!(x2 + x3 == L && y2 + y1 == L && y2 == y3)) {
      printf("-1\n");
      return 0;
    }
    printf("%d\n", L);
    for (int i = 1; i <= y1; i++) {
      for (int j = 1; j <= x1; j++) {
        printf("A");
      }
      printf("\n");
    }
    for (int i = 1; i <= L - y1; i++) {
      for (int j = 1; j <= L; j++) {
        if (j <= x2)
          printf("B");
        else
          printf("C");
      }
      printf("\n");
    }
  } else if (x2 == L) {
    if (x1 == L - y2) swap(x1, y1);
    if (x3 == L - y2) swap(x3, y3);
    if (!(x1 + x3 == L && y1 + y2 == L && y1 == y3)) {
      printf("-1\n");
      return 0;
    }
    printf("%d\n", L);
    for (int i = 1; i <= y2; i++) {
      for (int j = 1; j <= x2; j++) {
        printf("B");
      }
      printf("\n");
    }
    for (int i = 1; i <= L - y2; i++) {
      for (int j = 1; j <= L; j++) {
        if (j <= x1)
          printf("A");
        else
          printf("C");
      }
      printf("\n");
    }
  } else if (x3 == L) {
    if (x2 == L - y3) swap(x2, y2);
    if (x1 == L - y3) swap(x1, y1);
    if (!(x2 + x1 == L && y1 + y3 == L && y1 == y2)) {
      printf("-1\n");
      return 0;
    }
    printf("%d\n", L);
    for (int i = 1; i <= y3; i++) {
      for (int j = 1; j <= x3; j++) {
        printf("C");
      }
      printf("\n");
    }
    for (int i = 1; i <= L - y3; i++) {
      for (int j = 1; j <= L; j++) {
        if (j <= x1)
          printf("A");
        else
          printf("B");
      }
      printf("\n");
    }
  }
  return 0;
}
