#include <bits/stdc++.h>
using namespace std;
int main() {
  int ax, ay, bx, by, cx, cy;
  scanf("%d %d %d %d %d %d", &ax, &ay, &bx, &by, &cx, &cy);
  for (int A = 0; A < 2; A++) {
    swap(ax, ay);
    for (int B = 0; B < 2; B++) {
      swap(bx, by);
      for (int C = 0; C < 2; C++) {
        swap(cx, cy);
        if (((ax == bx) && (bx == cx)) && ((ay + by + cy) == ax)) {
          printf("%d\n", ax);
          for (int I = 0; I < (ay); I++) {
            for (int J = 0; J < (ax); J++) printf("A");
            printf("\n");
          }
          for (int I = 0; I < (by); I++) {
            for (int J = 0; J < (bx); J++) printf("B");
            printf("\n");
          }
          for (int I = 0; I < (cy); I++) {
            for (int J = 0; J < (cx); J++) printf("C");
            printf("\n");
          }
          return 0;
        }
        if ((ax + bx == cx) && (ay == by && (ay + cy == ax + bx))) {
          printf("%d\n", ax + bx);
          for (int I = 0; I < (ay); I++) {
            for (int J = 0; J < (ax + bx); J++) {
              if (J < ax)
                printf("A");
              else
                printf("B");
            }
            printf("\n");
          }
          for (int I = 0; I < cy; I++) {
            for (int J = 0; J < cx; J++) printf("C");
            printf("\n");
          }
          return 0;
        }
        if ((ax + cx == bx) && (ay == cy && (ay + by == ax + cx))) {
          printf("%d\n", ax + cx);
          for (int I = 0; I < (ay); I++) {
            for (int J = 0; J < (ax + cx); J++) {
              if (J < ax)
                printf("A");
              else
                printf("C");
            }
            printf("\n");
          }
          for (int I = 0; I < by; I++) {
            for (int J = 0; J < bx; J++) printf("B");
            printf("\n");
          }
          return 0;
        }
        if ((bx + cx == ax) && (by == cy && (by + ay == bx + cx))) {
          printf("%d\n", cx + bx);
          for (int I = 0; I < (by); I++) {
            for (int J = 0; J < (bx + cx); J++) {
              if (J < bx)
                printf("B");
              else
                printf("C");
            }
            printf("\n");
          }
          for (int I = 0; I < ay; I++) {
            for (int J = 0; J < ax; J++) printf("A");
            printf("\n");
          }
          return 0;
        }
      }
    }
  }
  printf("-1");
  return 0;
}
