#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
struct node {
  int x, y;
  char ch;
};
bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  node a[4];
  int i, j;
  scanf("%d", &a[0].x);
  scanf("%d", &a[0].y);
  scanf("%d", &a[1].x);
  scanf("%d", &a[1].y);
  scanf("%d", &a[2].x);
  scanf("%d", &a[2].y);
  a[0].ch = 'A';
  a[1].ch = 'B';
  a[2].ch = 'C';
  if (a[0].x < a[0].y) swap(a[0].x, a[0].y);
  if (a[1].x < a[1].y) swap(a[1].x, a[1].y);
  if (a[2].x < a[2].y) swap(a[2].x, a[2].y);
  sort(a, a + 3, cmp);
  if ((a[0].x == a[2].x) && (a[1].x == a[2].x) &&
      ((a[0].y + a[1].y + a[2].y) == a[2].x)) {
    cout << a[2].x << endl;
    for (i = 0; i < a[2].y; i++) {
      for (j = 0; j < a[2].x; j++) cout << a[2].ch;
      cout << endl;
    }
    for (i = 0; i < a[1].y; i++) {
      for (j = 0; j < a[1].x; j++) cout << a[1].ch;
      cout << endl;
    }
    for (i = 0; i < a[0].y; i++) {
      for (j = 0; j < a[0].x; j++) cout << a[0].ch;
      cout << endl;
    }
  } else if (a[0].x + a[1].x == a[2].x && a[0].y == a[1].y &&
             a[0].y + a[2].y == a[2].x) {
    cout << a[2].x << endl;
    for (i = 0; i < a[2].y; i++) {
      for (j = 0; j < a[2].x; j++) cout << a[2].ch;
      cout << endl;
    }
    for (i = 0; i < a[0].y; i++) {
      for (j = 0; j < a[0].x; j++) cout << a[0].ch;
      for (j = 0; j < a[1].x; j++) cout << a[1].ch;
      cout << endl;
    }
  } else if (a[0].x + a[1].y == a[2].x && a[0].y == a[1].x &&
             a[0].y + a[2].y == a[2].x) {
    cout << a[2].x << endl;
    for (i = 0; i < a[2].y; i++) {
      for (j = 0; j < a[2].x; j++) cout << a[2].ch;
      cout << endl;
    }
    for (i = 0; i < a[0].y; i++) {
      for (j = 0; j < a[0].x; j++) cout << a[0].ch;
      for (j = 0; j < a[1].y; j++) cout << a[1].ch;
      cout << endl;
    }
  } else if (a[0].y + a[1].x == a[2].x && a[0].x == a[1].y &&
             a[0].x + a[2].y == a[2].x) {
    cout << a[2].x << endl;
    for (i = 0; i < a[2].y; i++) {
      for (j = 0; j < a[2].x; j++) cout << a[2].ch;
      cout << endl;
    }
    for (i = 0; i < a[0].x; i++) {
      for (j = 0; j < a[0].y; j++) cout << a[0].ch;
      for (j = 0; j < a[1].x; j++) cout << a[1].ch;
      cout << endl;
    }
  } else if (a[0].y + a[1].y == a[2].x && a[0].x == a[1].x &&
             a[0].x + a[2].y == a[2].x) {
    cout << a[2].x << endl;
    for (i = 0; i < a[2].y; i++) {
      for (j = 0; j < a[2].x; j++) cout << a[2].ch;
      cout << endl;
    }
    for (i = 0; i < a[0].x; i++) {
      for (j = 0; j < a[0].y; j++) cout << a[0].ch;
      for (j = 0; j < a[1].y; j++) cout << a[1].ch;
      cout << endl;
    }
  } else {
    cout << "-1";
  }
  return 0;
}
