#include <bits/stdc++.h>
using namespace std;
int a[6][3] = {0, 1, 2, 0, 2, 1, 1, 0, 2, 1, 2, 0, 2, 0, 1, 2, 1, 0};
int b[8][6] = {
    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0,
    1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0,
};
char c[3] = {'A', 'B', 'C'};
inline void pl(int x, int y) {
  for (int i = 0; i < x; i++) putchar(c[y]);
}
int d[3][2];
int main(void) {
  for (int i = 0; i < 3; i++) scanf("%d %d", &d[i][0], &d[i][1]);
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 8; j++) {
      int A = a[i][0], B = a[i][1], C = a[i][2];
      int xa = d[A][b[j][0]], ya = d[A][b[j][1]];
      int xb = d[B][b[j][2]], yb = d[B][b[j][3]];
      int xc = d[C][b[j][4]], yc = d[C][b[j][5]];
      if (ya == yb && xa + xb == xc && ya + yc == xc) {
        printf("%d\n", xc);
        for (int p = 1; p <= ya; p++) pl(xa, A), pl(xb, B), puts("");
        for (int p = 1; p <= yc; p++) pl(xc, C), puts("");
        return 0;
      }
      if (ya == yb && yb == yc && xa + xb + xc == ya) {
        printf("%d\n", ya);
        for (int p = 1; p <= ya; p++) pl(xa, A), pl(xb, B), pl(xc, C), puts("");
        return 0;
      }
    }
  }
  puts("-1");
  return 0;
}
