#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  int x[3], y[3], Area = 0, sum = 0;
  for (int i = 0; i < 3; i++) {
    cin >> x[i] >> y[i];
    if (x[i] < y[i]) swap(x[i], y[i]);
    sum += (x[i] * y[i]);
    Area = max(Area, x[i]);
  }
  if (Area * Area != sum) {
    cout << "-1\n", exit(0);
  }
  cout << Area << "\n";
  int row = Area;
  bool vis[3];
  memset(vis, 0, sizeof vis);
  for (int i = 0; i < 3; i++) {
    if (x[i] == Area) {
      for (int j = 0; j < y[i]; j++) {
        for (int k = 0; k < Area; k++) cout << (char)('A' + i);
        cout << "\n";
      }
      row -= y[i];
      vis[i] = true;
    }
  }
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < 3; j++) {
      if (!vis[j]) {
        if (x[j] == row) {
          for (int k = 0; k < y[j]; k++) cout << (char)('A' + j);
        } else {
          for (int k = 0; k < x[j]; k++) cout << (char)('A' + j);
        }
      }
    }
    cout << "\n";
  }
  cout << "\n";
  return 0;
}
