#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int x;
  int y;
  char num;
} node;
bool cmp(node a, node b) { return a.y > b.y; }
int main(int argc, char const *argv[]) {
  node a[4];
  for (int i = 0; i < 3; ++i) {
    cin >> a[i].x >> a[i].y;
    if (a[i].x > a[i].y) {
      int temp = a[i].x;
      a[i].x = a[i].y;
      a[i].y = temp;
    }
    a[i].num = 'A' + i;
  }
  sort(a, a + 3, cmp);
  if (a[0].y * a[0].y != a[0].x * a[0].y + a[1].x * a[1].y + a[2].x * a[2].y) {
    cout << -1 << endl;
  } else {
    cout << a[0].y << endl;
    for (int i = 0; i < a[0].x; ++i) {
      for (int j = 0; j < a[0].y; ++j) {
        cout << a[0].num;
      }
      cout << endl;
    }
    if (a[1].y == a[0].y && a[0].y == a[2].y) {
      for (int k = 1; k < 3; ++k) {
        for (int i = 0; i < a[k].x; ++i) {
          for (int j = 0; j < a[k].y; ++j) {
            cout << a[k].num;
          }
          cout << endl;
        }
      }
    } else {
      if (a[1].x == a[2].y) {
        int temp = a[1].x;
        a[1].x = a[1].y;
        a[1].y = temp;
      } else if (a[2].x == a[1].y) {
        int temp = a[2].x;
        a[2].x = a[2].y;
        a[2].y = temp;
      } else if (a[1].x == a[2].x) {
        int temp = a[1].x;
        a[1].x = a[1].y;
        a[1].y = temp;
        temp = a[2].x;
        a[2].x = a[2].y;
        a[2].y = temp;
      }
      for (int i = 0; i < a[1].y; ++i) {
        for (int j = 0; j < a[1].x; j++) {
          cout << a[1].num;
        }
        for (int j = 0; j < a[2].x; j++) {
          cout << a[2].num;
        }
        cout << endl;
      }
    }
  }
  return 0;
}
