#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, x2, y1, y2, x3, y3;
  scanf("%d%d%d", &x1, &y1, &x2);
  scanf("%d%d%d", &y2, &x3, &y3);
  for (int i = 0; i < 9; i++) {
    int k = i, l = 0, h1, h2, h3, r1, r2;
    if (k % 2 == 1) {
      l += x1;
      r1 = x1 + 1;
      h1 = y1;
    } else {
      l += y1;
      r1 = y1 + 1;
      h1 = x1;
    }
    k /= 2;
    if (k % 2 == 1) {
      l += x2;
      r2 = x2 + 1;
      h2 = y2;
    } else {
      l += y2;
      r2 = y2 + 1;
      h2 = x2;
    }
    k /= 2;
    if (k % 2 == 1) {
      l += x3;
      h3 = y3;
    } else {
      l += y3;
      h3 = x3;
    }
    k /= 2;
    if (l == h1 && h1 == h2 && h2 == h3) {
      k = i;
      printf("%d\n", l);
      for (int j = 1; j <= l; j++) {
        for (int i = 1; i < r1; i++) printf("A");
        for (int i = r1; i < r2 + r1 - 1; i++) printf("B");
        for (int i = r2 + r1 - 1; i <= l; i++) printf("C");
        printf("\n");
      }
      return 0;
    }
  }
  pair<int, int> ar[4];
  ar[1] = make_pair(x1, y1);
  ar[2] = make_pair(x2, y2);
  ar[3] = make_pair(x3, y3);
  for (int q = 1; q <= 3; q++) {
    x1 = ar[q].first;
    y1 = ar[q].second;
    if (q == 1) {
      x2 = ar[2].first;
      y2 = ar[2].second;
      x3 = ar[3].first;
      y3 = ar[3].second;
    } else if (q == 2) {
      x2 = ar[1].first;
      y2 = ar[1].second;
      x3 = ar[3].first;
      y3 = ar[3].second;
    } else if (q == 3) {
      x2 = ar[1].first;
      y2 = ar[1].second;
      x3 = ar[2].first;
      y3 = ar[2].second;
    }
    for (int i = 0; i < 9; i++) {
      int l1 = 0, h = 0, k = i, h1, l2, l3, r1, h2;
      if (k % 2 == 1) {
        l1 = x1;
        r1 = x1 + 1;
        h1 = y1;
      } else {
        l1 = y1;
        r1 = y1 + 1;
        h1 = x1;
      }
      k /= 2;
      if (k % 2 == 1) {
        l2 = x2;
        h += y2;
        h2 = y2;
      } else {
        l2 = y2;
        h += x2;
        h2 = x2;
      }
      k /= 2;
      if (k % 2 == 1) {
        l3 = x3;
        h += y3;
      } else {
        l3 = y3;
        h += x3;
      }
      k /= 2;
      k = i;
      if (l2 == l3 && h1 == h && h1 == (l1 + l2)) {
        printf("%d\n", h1);
        for (int i = 1; i <= h2; i++) {
          for (int j = 1; j < r1; j++) {
            if (q == 1) printf("A");
            if (q == 2) printf("B");
            if (q == 3) printf("C");
          }
          for (int j = r1; j <= h; j++) {
            if (q == 1)
              printf("B");
            else if (q == 2)
              printf("A");
            else if (q == 3)
              printf("A");
          }
          printf("\n");
        }
        for (int i = h2 + 1; i <= h; i++) {
          for (int j = 1; j < r1; j++) {
            if (q == 1) printf("A");
            if (q == 2) printf("B");
            if (q == 3) printf("C");
          }
          for (int j = r1; j <= h; j++) {
            if (q == 1)
              printf("C");
            else if (q == 2)
              printf("C");
            else if (q == 3)
              printf("B");
          }
          printf("\n");
        }
        return 0;
      }
    }
  }
  printf("-1\n");
  return 0;
}
