#include <bits/stdc++.h>
using namespace std;
int maxlen(int x1, int x2, int x3) {
  if (x1 >= x2 && x1 >= x3) return 1;
  if (x2 >= x1 && x2 >= x3) return 2;
  if (x3 >= x2 && x3 >= x1) return 3;
}
int equals(int x1, int y1, int x2, int y2) {
  if (x1 == y2) return x1;
  if (x1 == x2) return x1;
  if (y1 == y2) return y1;
  if (y1 == x2) return y1;
  return -10086;
}
int notequal(int x1, int y1, int eq) {
  if (x1 != eq) return x1;
  return y1;
}
int main() {
  bool bo = true;
  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);
  if (x1 == x2 && x2 == x3) {
    if (y1 + y2 + y3 == x1) {
      bo = false;
      printf("%d\n", x1);
      for (int j = 1; j <= y1; j++) {
        for (int i = 1; i <= x1; i++) printf("A");
        printf("\n");
      }
      for (int j = 1; j <= y2; j++) {
        for (int i = 1; i <= x1; i++) printf("B");
        printf("\n");
      }
      for (int j = 1; j <= y3; j++) {
        for (int i = 1; i <= x1; i++) printf("C");
        printf("\n");
      }
    }
  }
  if (y1 == y2 && y2 == y3) {
    if (x1 + x2 + x3 == y1) {
      bo = false;
      printf("%d\n", y1);
      for (int j = 1; j <= x1; j++) {
        for (int i = 1; i <= y1; i++) printf("A");
        printf("\n");
      }
      for (int j = 1; j <= x2; j++) {
        for (int i = 1; i <= y1; i++) printf("B");
        printf("\n");
      }
      for (int j = 1; j <= x3; j++) {
        for (int i = 1; i <= y1; i++) printf("C");
        printf("\n");
      }
    }
  }
  if (maxlen(y1, y2, y3) == 1) {
    if (equals(x2, y2, x3, y3) + x1 == y1) {
      if (notequal(x2, y2, equals(x2, y2, x3, y3)) +
              notequal(x3, y3, equals(x2, y2, x3, y3)) ==
          y1) {
        bo = false;
        printf("%d\n", y1);
        for (int i = 1; i <= x1; i++) {
          for (int j = 1; j <= y1; j++) printf("A");
          printf("\n");
        }
        for (int i = 1; i <= equals(x2, y2, x3, y3); i++) {
          for (int j = 1; j <= notequal(x2, y2, equals(x2, y2, x3, y3)); j++)
            printf("B");
          for (int j = 1; j <= notequal(x3, y3, equals(x2, y2, x3, y3)); j++)
            printf("C");
          printf("\n");
        }
      }
    }
  } else if (maxlen(y1, y2, y3) == 2) {
    if (equals(x1, y1, x3, y3) + x2 == y2) {
      if (notequal(x1, y1, equals(x1, y1, x3, y3)) +
              notequal(x3, y3, equals(x1, y1, x3, y3)) ==
          y2) {
        bo = false;
        printf("%d\n", y2);
        for (int i = 1; i <= x2; i++) {
          for (int j = 1; j <= y2; j++) printf("B");
          printf("\n");
        }
        for (int i = 1; i <= equals(x1, y1, x3, y3); i++) {
          for (int j = 1; j <= notequal(x1, y1, equals(x1, y1, x3, y3)); j++)
            printf("A");
          for (int j = 1; j <= notequal(x3, y3, equals(x1, y1, x3, y3)); j++)
            printf("C");
          printf("\n");
        }
      }
    }
  } else if (maxlen(y1, y2, y3) == 3) {
    if (equals(x1, y1, x2, y2) + x3 == y3) {
      if (notequal(x1, y1, equals(x1, y1, x2, y2)) +
              notequal(x2, y2, equals(x1, y1, x2, y2)) ==
          y3) {
        bo = false;
        printf("%d\n", y3);
        for (int i = 1; i <= x3; i++) {
          for (int j = 1; j <= y3; j++) printf("C");
          printf("\n");
        }
        for (int i = 1; i <= equals(x1, y1, x2, y2); i++) {
          for (int j = 1; j <= notequal(x1, y1, equals(x1, y1, x2, y2)); j++)
            printf("A");
          for (int j = 1; j <= notequal(x2, y2, equals(x1, y1, x2, y2)); j++)
            printf("B");
          printf("\n");
        }
      }
    }
  }
  if (bo) printf("-1\n");
  return 0;
}
