#include <bits/stdc++.h>
using namespace std;
char rect_char(int index) {
  return index == 0 ? 'A' : ((index == 1) ? 'B' : 'C');
}
void print(char c, int x, int y) {
  for (int i = 0; i < y; i++) {
    cout << string(x, c) << "\n";
  }
}
int main() {
  vector<int> r(6);
  cin >> r[0] >> r[1] >> r[2] >> r[3] >> r[4] >> r[5];
  for (int i = 0; i < 3; i++) {
    if (r[2 * i] < r[2 * i + 1]) {
      swap(r[2 * i], r[2 * i + 1]);
    }
  }
  if (r[0] == r[2] && r[0] == r[4]) {
    if (r[1] + r[3] + r[5] == r[0]) {
      cout << r[0] << "\n";
      print('A', r[0], r[1]);
      print('B', r[2], r[3]);
      print('C', r[4], r[5]);
    } else {
      cout << "-1\n";
    }
  } else {
    vector<int>::iterator it = max_element((r).begin(), (r).end());
    int ml = *it;
    int mr = distance(r.begin(), it) / 2;
    int mw = distance(r.begin(), it) % 2 ? *(it - 1) : *(it + 1);
    int or1, or2;
    if (mr == 0) {
      or1 = 1;
      or2 = 2;
    } else if (mr == 1) {
      or1 = 0;
      or2 = 2;
    } else {
      or1 = 0;
      or2 = 1;
    }
    int a = -1, b = -1;
    if (r[2 * or1] == r[2 * or2] && (r[2 * or1 + 1] + r[2 * or2 + 1] == ml) &&
        (r[2 * or1] + mw == ml)) {
      a = 0;
      b = 0;
    } else if (r[2 * or1] == r[2 * or2 + 1] &&
               (r[2 * or1 + 1] + r[2 * or2] == ml) && (r[2 * or1] + mw == ml)) {
      a = 0;
      b = 1;
    } else if (r[2 * or1 + 1] == r[2 * or2] &&
               (r[2 * or1] + r[2 * or2 + 1] == ml) &&
               (r[2 * or1 + 1] + mw == ml)) {
      a = 1;
      b = 0;
    } else if (r[2 * or1 + 1] == r[2 * or2 + 1] &&
               (r[2 * or1] + r[2 * or2] == ml) && (r[2 * or1 + 1] + mw == ml)) {
      a = 1;
      b = 1;
    } else {
      cout << "-1\n";
    }
    if (a >= 0) {
      cout << ml << "\n";
      char lrc = rect_char(mr);
      for (int i = 0; i < mw; i++) {
        cout << string(ml, lrc) << "\n";
      }
      char or1c = rect_char(or1);
      char or2c = rect_char(or2);
      for (int i = 0; i < r[2 * or1 + a]; i++) {
        cout << string(r[2 * or1 + (a + 1) % 2], or1c);
        cout << string(r[2 * or2 + (b + 1) % 2], or2c) << "\n";
      }
    }
  }
  return 0;
}
