#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int n, m;
bool valid(int i, int j) { return i >= 0 && i < n && j >= 0 && j < n; }
set<long long> v;
void aml(long long num, long long i, long long j) {
  if (num > n) return;
  v.insert(num);
  if (num + i) aml((10LL * num + i), i, j);
  if (num + j) aml((10LL * num + j), j, i);
}
char ch[1000][1000];
int main() {
  fast();
  int a[4], b[4];
  int sum = 0, mx = 0, ind = -1;
  for (int i = 0; i < 3; i++) {
    cin >> a[i] >> b[i];
    if (a[i] > b[i]) swap(a[i], b[i]);
    sum += a[i] * b[i];
    if (mx < b[i]) {
      ind = i;
      mx = b[i];
    }
  }
  char ch[1000][1000];
  if (mx * mx != sum) return cout << -1, 0;
  if (ind == 0) {
    for (int i = 0; i < a[ind]; i++)
      for (int j = 0; j < b[ind]; j++) {
        ch[i][j] = 'A';
      }
    if (a[2] + a[1] + a[0] == mx)
      ;
    else if (b[1] == mx - a[0])
      swap(a[1], b[1]);
    for (int i = 0 + a[0]; i < a[1] + a[0]; i++)
      for (int j = 0; j < b[1]; j++) {
        ch[i][j] = 'B';
      }
    for (int i = 0; i < mx; i++)
      for (int j = 0; j < mx; j++) {
        if (ch[i][j] != 'A' && ch[i][j] != 'B') ch[i][j] = 'C';
      }
  }
  if (ind == 1) {
    for (int i = 0; i < a[1]; i++)
      for (int j = 0; j < b[1]; j++) {
        ch[i][j] = 'B';
      }
    if (a[2] + a[1] + a[0] == mx)
      ;
    else if (b[0] == mx - a[1])
      swap(a[0], b[0]);
    for (int i = 0 + a[1]; i < a[0] + a[1]; i++)
      for (int j = 0; j < b[0]; j++) {
        ch[i][j] = 'A';
      }
    for (int i = 0; i < mx; i++)
      for (int j = 0; j < mx; j++) {
        if (ch[i][j] != 'A' && ch[i][j] != 'B') ch[i][j] = 'C';
      }
  }
  if (ind == 2) {
    for (int i = 0; i < a[2]; i++)
      for (int j = 0; j < b[2]; j++) {
        ch[i][j] = 'C';
      }
    if (a[2] + a[1] + a[0] == mx)
      ;
    else if (b[0] == mx - a[2])
      swap(a[0], b[0]);
    for (int i = 0 + a[2]; i < a[0] + a[2]; i++)
      for (int j = 0; j < b[0]; j++) {
        ch[i][j] = 'A';
      }
    for (int i = 0; i < mx; i++)
      for (int j = 0; j < mx; j++) {
        if (ch[i][j] != 'A' && ch[i][j] != 'C') ch[i][j] = 'B';
      }
  }
  cout << mx << "\n";
  for (int i = 0; i < mx; i++) {
    for (int j = 0; j < mx; j++) {
      cout << ch[i][j];
    }
    cout << "\n";
  }
}
