#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
void solve1() {
  for (int mask = 0; mask < (1 << 3); mask++) {
    vector<pair<int, int> > points;
    for (int i = 0; i < 3; i++) {
      if (mask & (1 << i)) {
        points.push_back(make_pair(x[i], y[i]));
      } else {
        points.push_back(make_pair(y[i], x[i]));
      }
    }
    bool bad = false;
    int sum = 0;
    for (int i = 0; i < 3; i++) {
      if (points[i].second != points[0].second) {
        bad = true;
      }
      sum += points[i].first;
    }
    if (bad || sum != points[0].second) {
      continue;
    }
    cout << sum << "\n";
    for (int i = 0; i < 3; i++) {
      for (int xx = 1; xx <= points[i].first; xx++) {
        for (int yy = 1; yy <= points[i].second; yy++) {
          cout << char('A' + i);
        }
        cout << "\n";
      }
    }
    exit(0);
  }
}
void solve2() {
  int id[] = {0, 1, 2};
  do {
    for (int mask = 0; mask < (1 << 3); mask++) {
      vector<pair<int, int> > points;
      for (int i = 0; i < 3; i++) {
        if (mask & (1 << i)) {
          points.push_back(make_pair(x[id[i]], y[id[i]]));
        } else {
          points.push_back(make_pair(y[id[i]], x[id[i]]));
        }
      }
      if (points[0].second == points[1].second + points[2].second &&
          points[1].first == points[2].first &&
          points[0].first + points[1].first == points[0].second) {
        cout << points[0].second << "\n";
        for (int i = 1; i <= points[0].first; i++) {
          for (int j = 1; j <= points[0].second; j++) {
            cout << char('A' + id[0]);
          }
          cout << "\n";
        }
        for (int i = 1; i <= points[1].first; i++) {
          for (int j = 1; j <= points[1].second + points[2].second; j++) {
            if (j <= points[1].second) {
              cout << char('A' + id[1]);
            } else {
              cout << char('A' + id[2]);
            }
          }
          cout << "\n";
        }
        exit(0);
      }
    }
  } while (next_permutation(id, id + 3));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int i = 0; i < 3; i++) {
    cin >> x[i] >> y[i];
  }
  solve1();
  solve2();
  cout << -1;
  return 0;
}
