#include <bits/stdc++.h>
using namespace std;
int SQ[1000000 + 1];
void solve(vector<pair<int, int> > x) {
  int S = 0;
  for (int i = 0; i < 3; i++) S += x[i].first * x[i].second;
  if (SQ[S] == -1) {
    puts("-1");
    return;
  }
  int n = SQ[S];
  for (int it0 = 0; it0 < 2; it0++) {
    if (it0) swap(x[0].first, x[0].second);
    for (int it1 = 0; it1 < 2; it1++) {
      if (it1) swap(x[1].first, x[1].second);
      for (int it2 = 0; it2 < 2; it2++) {
        if (it2) swap(x[2].first, x[2].second);
        vector<int> p = {0, 1, 2};
        do {
          vector<pair<int, int> > X;
          for (int i = 0; i < 3; i++) X.push_back(x[p[i]]);
          if (X[0].second == n && X[1].second + X[2].second == n &&
              X[1].first == X[2].first)
            if (X[0].first + X[1].first == n) {
              printf("%d\n", n);
              for (int i = 0; i < n; i++) {
                if (i < X[0].first) {
                  for (int j = 0; j < n; j++) putchar('A' + p[0]);
                  puts("");
                } else {
                  for (int j = 0; j < n; j++)
                    if (j < X[1].second)
                      putchar('A' + p[1]);
                    else
                      putchar('A' + p[2]);
                  puts("");
                }
              }
              return;
            }
          if (X[0].first == n && X[1].first == n && X[2].first == n)
            if (X[0].second + X[1].second + X[2].second == n) {
              printf("%d\n", n);
              for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++)
                  if (j < X[0].second)
                    putchar('A' + p[0]);
                  else if (j < X[0].second + X[1].second)
                    putchar('A' + p[1]);
                  else
                    putchar('A' + p[2]);
                puts("");
              }
              return;
            }
        } while (next_permutation(p.begin(), p.end()));
      }
    }
  }
  puts("-1");
}
int main() {
  memset(SQ, -1, sizeof(SQ));
  for (int i = 0; i * i <= 1000000; ++i) SQ[i * i] = i;
  vector<pair<int, int> > x(3);
  while (cin >> x[0].first >> x[0].second) {
    for (int i = 0; i < 3; i++) {
      if (!i) continue;
      cin >> x[i].first >> x[i].second;
    }
    solve(x);
  }
}
