#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  long long tota = x1 * y1 + x2 * y2 + x3 * y3;
  double n = sqrt(tota);
  if (tota != (long long)n * n) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < 2; i++) {
    if (i) {
      swap(x1, y1);
    }
    string a(x1, 'A');
    for (int j = 0; j < 2; j++) {
      if (j) {
        swap(x2, y2);
      }
      string b(x2, 'B');
      for (int k = 0; k < 2; k++) {
        if (k) {
          swap(x3, y3);
        }
        string c(x3, 'C');
        if (y1 == y2 && y2 == y3 && x1 + x2 + x3 == n) {
          cout << n << endl;
          for (int q = 0; q < y1; q++) {
            cout << a << b << c << endl;
          }
          return 0;
        } else if (y1 == y2 && x1 + x2 == n && y1 + y3 == n) {
          cout << n << endl;
          for (int q = 0; q < y1; q++) {
            cout << a << b << endl;
          }
          for (int q = 0; q < y3; q++) {
            cout << c << endl;
          }
          return 0;
        } else if (y1 == y3 && x1 + x3 == n && y2 + y3 == n) {
          cout << n << endl;
          for (int q = 0; q < y1; q++) {
            cout << a << c << endl;
          }
          for (int q = 0; q < y2; q++) {
            cout << b << endl;
          }
          return 0;
        } else if (y2 == y3 && x2 + x3 == n && y1 + y2 == n) {
          cout << n << endl;
          for (int q = 0; q < y2; q++) {
            cout << b << c << endl;
          }
          for (int q = 0; q < y1; q++) {
            cout << a << endl;
          }
          return 0;
        }
      }
    }
  }
  cout << -1;
  return 0;
}
