#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
int ar[5];
int res[1001][1001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = (0); i < (3); ++i) ar[i] = i;
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  int area = x1 * y1 + x2 * y2 + x3 * y3;
  int sq = sqrt(area);
  if (sq * sq != area) {
    cout << -1 << endl;
    return 0;
  }
  if (max(x1, max(x2, max(x3, max(y1, max(y2, y3))))) > sq) {
    cout << -1 << endl;
    return 0;
  }
  if (x1 != sq && y1 != sq) {
    if (x2 != sq && y2 != sq) {
      if (x3 != sq && y3 != sq) {
        cout << -1 << endl;
        return 0;
      }
      swap(x1, x3);
      swap(y1, y3);
      swap(ar[0], ar[2]);
    } else {
      swap(x1, x2);
      swap(y1, y2);
      swap(ar[0], ar[1]);
    }
  }
  if (x1 < y1) swap(x1, y1);
  if (x2 > y2) swap(x2, y2);
  if (x3 > y3) swap(x3, y3);
  if (y2 == sq && y3 == sq && x2 + x3 == sq - y1) {
    for (int i = (0); i < (sq); ++i)
      for (int j = (0); j < (y1); ++j) res[i][j] = ar[0];
    for (int j = (y1); j < (y1 + x2); ++j)
      for (int i = (0); i < (sq); ++i) res[i][j] = ar[1];
    for (int j = (y1 + x2); j < (sq); ++j)
      for (int i = (0); i < (sq); ++i) res[i][j] = ar[2];
    cout << sq << endl;
    for (int i = (0); i < (sq); ++i) {
      for (int j = (0); j < (sq); ++j) cout << (char)(res[i][j] + 'A');
      cout << endl;
    }
    return 0;
  }
  if (x1 != sq) swap(x1, y1);
  if (x2 != sq - y1 && y2 != sq - y1) {
    cout << -1 << endl;
    return 0;
  }
  if (x3 != sq - y1 && y3 != sq - y1) {
    cout << -1 << endl;
    return 0;
  }
  if (y2 != sq - y1) swap(x2, y2);
  if (y3 != sq - y1) swap(x3, y3);
  if (x2 + x3 != sq) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = (0); i < (sq); ++i)
    for (int j = (0); j < (y1); ++j) res[i][j] = ar[0];
  for (int j = (y1); j < (sq); ++j)
    for (int i = (0); i < (x2); ++i) res[i][j] = ar[1];
  for (int j = (y1); j < (sq); ++j)
    for (int i = (x2); i < (sq); ++i) res[i][j] = ar[2];
  cout << sq << endl;
  for (int i = (0); i < (sq); ++i) {
    for (int j = (0); j < (sq); ++j) cout << (char)(res[i][j] + 'A');
    cout << endl;
  }
}
