#include <bits/stdc++.h>
using namespace std;
int X[3], Y[3];
int x[3], y[3];
int c[3];
int main() {
  for (int(i) = 0; (i) < (3); (i)++) scanf("%d%d", &Y[i], &X[i]);
  for (int(i) = 0; (i) < (3); (i)++) c[i] = i;
  do {
    for (int(i) = 0; (i) < (3); (i)++) x[i] = X[c[i]], y[i] = Y[c[i]];
    for (int(b) = 0; (b) < (1 << 3); (b)++) {
      for (int(i) = 0; (i) < (3); (i)++)
        if (b >> i & 1) swap(x[i], y[i]);
      if (x[0] + x[1] + x[2] == y[0] && y[0] == y[1] && y[1] == y[2]) {
        int cc = x[0] + x[1] + x[2];
        printf("%d\n", cc);
        for (int(i) = 0; (i) < (x[0]); (i)++) {
          for (int(j) = 0; (j) < (cc); (j)++) putchar(c[0] + 'A');
          putchar('\n');
        }
        for (int(i) = 0; (i) < (x[1]); (i)++) {
          for (int(j) = 0; (j) < (cc); (j)++) putchar(c[1] + 'A');
          putchar('\n');
        }
        for (int(i) = 0; (i) < (x[2]); (i)++) {
          for (int(j) = 0; (j) < (cc); (j)++) putchar(c[2] + 'A');
          putchar('\n');
        }
        return 0;
      }
      if (x[0] + x[1] == y[0] && x[1] == x[2] && y[0] == y[1] + y[2]) {
        int cc = y[0];
        printf("%d\n", cc);
        for (int(i) = 0; (i) < (x[0]); (i)++) {
          for (int(j) = 0; (j) < (cc); (j)++) putchar(c[0] + 'A');
          putchar('\n');
        }
        for (int(i) = 0; (i) < (x[1]); (i)++) {
          for (int(j) = 0; (j) < (y[1]); (j)++) putchar(c[1] + 'A');
          for (int(j) = 0; (j) < (y[2]); (j)++) putchar(c[2] + 'A');
          putchar('\n');
        }
        return 0;
      }
      for (int(i) = 0; (i) < (3); (i)++)
        if (b >> i & 1) swap(x[i], y[i]);
    }
  } while (next_permutation(c, c + 3));
  puts("-1");
}
