#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[3], y[3];
  cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
  int area = x[0] * y[0] + x[1] * y[1] + x[2] * y[2];
  int side = sqrt(area);
  char ch[3];
  ch[0] = 'A';
  ch[1] = 'B';
  ch[2] = 'C';
  int flag = 0;
  if ((side * side) != area) {
    cout << -1;
    return 0;
  }
  vector<int> v;
  for (int i = 0; i < 3; i++) {
    if (y[i] == side) swap(x[i], y[i]);
    if (x[i] == side) v.push_back(i);
  }
  if (v.size() == 3) {
    cout << side << endl;
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < y[i]; j++) {
        for (int k = 0; k < side; k++) cout << ch[i];
        printf("\n");
      }
    }
    flag = 1;
  } else if (v.size() == 1) {
    int cur = v[0];
    int rem = side - y[cur];
    int cnt = 0;
    for (int i = 0; i < 3; i++) {
      if (i != cur) {
        if (y[i] == rem) swap(x[i], y[i]);
        if (x[i] == rem) cnt++;
      }
    }
    if (cnt == 2) {
      cout << side << endl;
      for (int i = 0; i < y[cur]; i++) {
        for (int j = 0; j < side; j++) cout << ch[cur];
        puts("");
      }
      int tmp1 = (cur + 1) % 3;
      int tmp2 = (cur + 2) % 3;
      for (int i = 0; i < rem; i++) {
        for (int j = 0; j < y[tmp1]; j++) cout << ch[tmp1];
        for (int j = 0; j < y[tmp2]; j++) cout << ch[tmp2];
        puts("");
      }
      flag = 1;
    }
  }
  if (!flag) cout << -1;
  return 0;
}
