#include <bits/stdc++.h>
using namespace std;
char T(int i) {
  if (i == 0) return 'A';
  if (i == 1) return 'B';
  if (i == 2) return 'C';
}
int func(pair<long long, long long> b[], int i, int j, int k) {
  if (b[i].first + b[j].first == b[k].first && b[i].second == b[j].second &&
      b[i].second + b[k].second == b[k].first) {
    cout << b[k].first << endl;
    for (int(r) = (0); (r) < (b[k].second); (r)++) {
      for (int(l) = (0); (l) < (b[k].first); (l)++) cout << T(k);
      cout << endl;
    }
    for (int(r) = (0); (r) < (b[i].second); (r)++) {
      for (int(l) = (0); (l) < (b[i].first + b[j].first); (l)++) {
        if (l < b[i].first)
          cout << T(i);
        else
          cout << T(j);
      }
      cout << endl;
    }
    return 1;
  }
  return 0;
}
int main() {
  pair<long long, long long> a[3];
  for (int(i) = (0); (i) < (3); (i)++) cin >> a[i].first >> a[i].second;
  long long flag = 0;
  for (int(i) = (0); (i) < (8); (i)++) {
    pair<long long, long long> b[3];
    for (int(j) = (0); (j) < (3); (j)++) {
      if (i & (1 << (2 - j))) {
        b[j] = make_pair(a[j].second, a[j].first);
      } else
        b[j] = a[j];
    }
    if (b[0].first == b[1].first && b[1].first == b[2].first &&
        b[0].second + b[1].second + b[2].second == b[0].first) {
      cout << b[0].first << endl;
      for (int(l) = (0); (l) < (3); (l)++) {
        for (int(j) = (0); (j) < (b[l].second); (j)++) {
          for (int(k) = (0); (k) < (b[l].first); (k)++) {
            if (l == 0)
              cout << "A";
            else if (l == 1)
              cout << "B";
            else
              cout << "C";
          }
          cout << endl;
        }
      }
      flag = 1;
      break;
    }
    long long c = func(b, 0, 1, 2);
    flag |= c;
    if (c) break;
    c = func(b, 0, 2, 1);
    flag |= c;
    if (c) break;
    c = func(b, 1, 2, 0);
    flag |= c;
    if (c) break;
  }
  if (!flag) cout << "-1\n";
  return 0;
}
