#include <bits/stdc++.h>
using namespace std;
void align(int &x, int &y) {
  if (y > x) swap(x, y);
}
void print(int x, int y, char c) {
  for (int i = 0; i < y; i++) {
    for (int j = 0; j < x; j++) printf("%c", c);
    printf("\n");
  }
}
void printr(int x1, int x2, int y, char c1, char c2) {
  for (int i = 0; i < y; i++) {
    for (int j = 0; j < x1; j++) printf("%c", c1);
    for (int j = 0; j < x2; j++) printf("%c", c2);
    printf("\n");
  }
}
int main() {
  int xa, ya, xb, yb, xc, yc;
  char ca = 'A', cb = 'B', cc = 'C';
  scanf("%d%d%d%d%d%d", &xa, &ya, &xb, &yb, &xc, &yc);
  align(xa, ya);
  align(xb, yb);
  align(xc, yc);
  if (xb >= xa && xb >= xc) {
    swap(xa, xb);
    swap(ya, yb);
    swap(ca, cb);
  } else if (xc >= xa && xc >= xa) {
    swap(xa, xc);
    swap(ya, yc);
    swap(ca, cc);
  }
  int area = xa * ya + xb * yb + xc * yc, side;
  side = sqrt(area);
  if (side * side != area)
    printf("-1\n");
  else if (xa > side || xb > side || xc > side)
    printf("-1\n");
  else if (xa == xb && xb == xc) {
    printf("%d\n", side);
    print(xa, ya, ca);
    print(xb, yb, cb);
    print(xc, yc, cc);
  } else if (xa == side && xb != side && xc != side) {
    bool found = false;
    if (xb == xc && yb + yc == side && ya + xb == side)
      found = true;
    else if (xb == yc && yb + xc == side && ya + xb == side)
      found = true;
    else if (yb == xc && xb + yc == side && ya + xc == side)
      found = true;
    else if (yb == yc && xb + xc == side && ya + yb == side)
      found = true;
    if (found) {
      printf("%d\n", side);
      print(xa, ya, ca);
      if (xb == xc && yb + yc == side && ya + xb == side)
        printr(yb, yc, xb, cb, cc);
      else if (xb == yc && yb + xc == side && ya + xb == side)
        printr(yb, xc, xb, cb, cc);
      else if (yb == xc && xb + yc == side && ya + xc == side)
        printr(xb, yc, xc, cb, cc);
      else if (yb == yc && xb + xc == side && ya + yb == side)
        printr(xb, xc, yb, cb, cc);
    } else
      printf("-1\n");
  } else
    printf("-1\n");
  return 0;
}
