#include <bits/stdc++.h>
using namespace std;
char bb[10000][10000];
vector<pair<pair<int, int>, char> > sides;
bool srt(pair<pair<int, int>, char> a, pair<pair<int, int>, char> b) {
  return a.first.first > b.first.first;
}
int main() {
  int x1, y1, x2, y2, x3, y3;
  int a1, b1, a2, b2, a3, b3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  int a = x1 * y1 + x2 * y2 + x3 * y3;
  int s = sqrt(a);
  if (s * s != a) {
    cout << "-1" << endl;
    ;
    return 0;
  }
  a1 = max(x1, y1);
  b1 = min(x1, y1);
  a2 = max(x2, y2);
  b2 = min(x2, y2);
  a3 = max(x3, y3);
  b3 = min(x3, y3);
  sides.push_back(make_pair(make_pair(a1, b1), 'A'));
  sides.push_back(make_pair(make_pair(a2, b2), 'B'));
  sides.push_back(make_pair(make_pair(a3, b3), 'C'));
  sort(sides.begin(), sides.end(), srt);
  if (sides[0].first.first != s) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < sides[0].first.first; i++) {
    for (int j = 0; j < sides[0].first.second; j++) {
      bb[i][j] = sides[0].second;
    }
  }
  if (sides[1].first.first == s) {
    for (int i = 0; i < sides[1].first.first; i++) {
      for (int j = sides[0].first.second;
           j < sides[0].first.second + sides[1].first.second; j++) {
        bb[i][j] = sides[1].second;
      }
    }
    for (int i = 0; i < sides[2].first.first; i++) {
      for (int j = sides[0].first.second + sides[1].first.second; j < s; j++) {
        bb[i][j] = sides[2].second;
      }
    }
  } else {
    int b;
    if (sides[0].first.second + sides[1].first.second == s) {
      for (int i = 0; i < sides[1].first.first; i++) {
        for (int j = sides[0].first.second; j < s; j++) {
          bb[i][j] = sides[1].second;
        }
      }
      b = sides[1].first.first;
    } else {
      for (int i = 0; i < sides[1].first.second; i++) {
        for (int j = sides[0].first.second; j < s; j++) {
          bb[i][j] = sides[1].second;
        }
      }
      b = sides[1].first.second;
    }
    for (int i = b; i < s; i++) {
      for (int j = sides[0].first.second; j < s; j++) {
        bb[i][j] = sides[2].second;
      }
    }
  }
  cout << s << endl;
  for (int i = 0; i < s; i++) {
    for (int j = 0; j < s; j++) {
      cout << bb[i][j];
    }
    cout << endl;
  }
  return 0;
}
