#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[30], y[30], k = 0, n = 0, s = 0;
  for (int i = 1; i <= 3; i++) {
    cin >> x[i] >> y[i];
    if (x[i] > k) k = x[i], n = i, s = y[i];
    if (y[i] > k) k = y[i], n = i, s = x[i];
  }
  int n1 = 0, s1 = 0;
  for (int i = 1; i <= 3; i++) {
    if (n == i) continue;
    if (x[i] == k - s) n1 = i, s1 = y[i];
    if (y[i] == k - s) n1 = i, s1 = x[i];
  }
  int d = 6 - (n1 + n);
  if ((x[d] == k - s && y[d] == k - s1) || (x[d] == k - s1 && y[d] == k - s)) {
    cout << k << endl;
    for (int i = 1; i <= k; i++) {
      for (int j = 1; j <= k; j++) {
        if (i <= s) {
          if (n == 1)
            cout << "A";
          else if (n == 2)
            cout << "B";
          else
            cout << "C";
        } else if (j <= s1) {
          if (n1 == 1)
            cout << "A";
          else if (n1 == 2)
            cout << "B";
          else
            cout << "C";
        } else {
          if (d == 1)
            cout << "A";
          else if (d == 2)
            cout << "B";
          else
            cout << "C";
        }
      }
      cout << endl;
    }
  } else if (max(x[1], y[1]) == max(x[2], y[2]) && max(x[3], y[3]) == k &&
             min(x[1], y[1]) + min(x[2], y[2]) + min(x[3], y[3]) == k) {
    cout << k << endl;
    for (int i = 1; i <= k; i++) {
      for (int j = 1; j <= k; j++) {
        if (i <= min(x[1], y[1])) {
          cout << "A";
        } else if (i <= min(x[2], y[2]) + min(x[1], y[1])) {
          cout << "B";
        } else {
          cout << "C";
        }
      }
      cout << endl;
    }
  } else
    cout << -1;
  return 0;
}
