#include <bits/stdc++.h>
using namespace std;
int main() {
  int xx[3], yy[3];
  for (int i = 0; i < 3; i++) cin >> xx[i] >> yy[i];
  for (int tmp = 0; tmp < 8; tmp++) {
    int x[3], y[3];
    for (int i = 0; i < 3; i++) {
      if (tmp & (1 << i)) {
        x[i] = yy[i];
        y[i] = xx[i];
      } else {
        x[i] = xx[i];
        y[i] = yy[i];
      }
    }
    if (x[0] == x[1] && x[1] == x[2]) {
      if (y[0] + y[1] + y[2] == x[0]) {
        int n = x[0];
        cout << n << endl;
        for (int i = 0; i < y[0]; i++) {
          for (int j = 0; j < n; j++) {
            cout << 'A';
          }
          cout << endl;
        }
        for (int i = y[0]; i < y[0] + y[1]; i++) {
          for (int j = 0; j < n; j++) {
            cout << 'B';
          }
          cout << endl;
        }
        for (int i = y[0] + y[1]; i < n; i++) {
          for (int j = 0; j < n; j++) {
            cout << 'C';
          }
          cout << endl;
        }
        return 0;
      }
    }
    for (int i = 0; i < 3; i++) {
      if (x[i] == x[(i + 1) % 3] + x[(i + 2) % 3]) {
        if (y[(i + 1) % 3] == y[(i + 2) % 3] && y[i] + y[(i + 1) % 3] == x[i]) {
          int n = x[i];
          cout << n << endl;
          char a[4] = "ABC";
          for (int j = 0; j < y[i]; j++) {
            for (int k = 0; k < n; k++) {
              cout << a[i];
            }
            cout << endl;
          }
          for (int j = y[i]; j < n; j++) {
            for (int k = 0; k < x[(i + 1) % 3]; k++) cout << a[(i + 1) % 3];
            for (int k = x[(i + 1) % 3]; k < n; k++) cout << a[(i + 2) % 3];
            cout << endl;
          }
          return 0;
        }
      }
    }
  }
  cout << -1 << endl;
}
