#include <bits/stdc++.h>
using namespace std;
int a[2][3], s[3], k = 0;
bool check1() {
  bool flag = true;
  for (int i = 0; i < 3; ++i) {
    flag = flag && (a[0][i] == k || a[1][i] == k);
  }
  return flag;
}
void go1() {
  if (check1()) {
    for (int i = 0; i < 3; ++i) {
      if (a[1][i] == k) {
        swap(a[0][i], a[1][i]);
      }
    }
    if (a[1][0] + a[1][1] + a[1][2] != k) {
      cout << "-1\n";
      exit(0);
    }
    cout << k << '\n';
    for (char ch = 'A'; ch <= 'C'; ++ch) {
      for (int i = 0; i < a[1][ch - 'A']; ++i) {
        for (int j = 0; j < k; ++j) {
          cout << ch;
        }
        cout << '\n';
      }
    }
    exit(0);
  }
}
void go2() {
  int t = -1;
  for (int i = 0; i < 3; ++i) {
    if (a[0][i] == k || a[1][i] == k) {
      t = i;
      break;
    }
  }
  if (t == -1) {
    cout << "-1\n";
    exit(0);
  }
  if (a[1][t] == k) {
    swap(a[0][t], a[1][t]);
  }
  int m = k - a[1][t];
  for (int i = 0; i < 3; ++i) {
    if (i == t) continue;
    if (a[1][i] != m) {
      swap(a[0][i], a[1][i]);
    }
  }
  for (int i = 0; i < 3; ++i) {
    if (i == t) continue;
    if (a[1][i] != m) {
      cout << "-1\n";
      exit(0);
    }
  }
  char ch = (char)('A' + t);
  cout << k << '\n';
  for (int i = 0; i < a[1][t]; ++i) {
    for (int j = 0; j < k; ++j) {
      cout << ch;
    }
    cout << '\n';
  }
  char c[2];
  int j = 0;
  for (char r = 'A'; r <= 'C'; ++r) {
    if (r == ch) continue;
    c[j++] = r;
  }
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < a[0][c[0] - 'A']; ++j) {
      cout << c[0];
    }
    for (int j = 0; j < a[0][c[1] - 'A']; ++j) {
      cout << c[1];
    }
    cout << '\n';
  }
}
void solve() {
  cin >> a[0][0] >> a[1][0] >> a[0][1] >> a[1][1] >> a[0][2] >> a[1][2];
  for (int i = 0; i < 3; ++i) {
    s[i] = a[0][i] * a[1][i];
  }
  int sq = s[0] + s[1] + s[2];
  k = 1;
  while (k * k < sq) ++k;
  if (k * k > sq) {
    cout << "-1\n";
  } else {
    go1();
    go2();
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
