#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vec(3);
vector<pair<int, int> > tmp;
vector<pair<int, int> > all;
int leng;
map<pair<int, int>, set<char> > mp;
char get(pair<int, int> p) {
  if (p.first > p.second) swap(p.first, p.second);
  char ans = (*mp[p].begin());
  mp[p].erase(ans);
  return ans;
}
void add(pair<int, int> p, char c) {
  if (p.first > p.second) swap(p.first, p.second);
  mp[p].insert(c);
}
bool isgood() {
  for (int i = 0; i < (int)all.size(); i++) {
    if (tmp[0].first == leng && tmp[1].first == leng && tmp[2].first == leng) {
    } else if (tmp[0].second == leng && tmp[1].second == leng &&
               tmp[2].second == leng) {
      cout << leng << "\n";
      char c = get(tmp[1]);
      for (int i = 0; i < tmp[1].first; i++) {
        for (int j = 0; j < tmp[1].second; j++) cout << c;
        cout << "\n";
      }
      c = get(tmp[0]);
      for (int i = 0; i < tmp[0].first; i++) {
        for (int j = 0; j < tmp[0].second; j++) cout << c;
        cout << "\n";
      }
      c = get(tmp[2]);
      for (int i = 0; i < tmp[2].first; i++) {
        for (int j = 0; j < tmp[2].second; j++) cout << c;
        cout << "\n";
      }
      exit(0);
    } else {
      pair<int, int> rec1, rec2;
      rec1.first = all[i].first - tmp[0].first;
      rec1.second = all[i].second;
      rec2.first = tmp[0].first;
      rec2.second = all[i].second - tmp[0].second;
      if (rec1 == tmp[2] && tmp[1] == rec2)
        if (tmp[0].second != leng) return 1;
      rec1.first = all[i].first - tmp[0].first;
      rec1.second = tmp[0].second;
      rec2.first = all[i].first;
      rec2.second = all[i].second - tmp[0].second;
      if (rec1 == tmp[2] && tmp[1] == rec2)
        if (tmp[0].second != leng) return 1;
    }
  }
  return 0;
}
bool solve() {
  for (int msk = 0; msk < (1 << 3); msk++) {
    tmp = vec;
    for (int i = 0; i < 3; i++) {
      if (msk & (1 << i)) swap(tmp[i].first, tmp[i].second);
    }
    if (isgood()) {
      string str = string(leng, '*');
      vector<string> ans(leng, str);
      char c = get(tmp[0]);
      for (int i = 0; i < tmp[0].first; i++)
        for (int j = 0; j < tmp[0].second; j++) ans[i][j] = c;
      c = get(tmp[1]);
      for (int i = 0; i < tmp[1].first; i++)
        for (int j = tmp[0].second; j < leng; j++) ans[i][j] = c;
      c = get(tmp[2]);
      for (int i = 0; i < leng; i++)
        for (int j = 0; j < leng; j++)
          if (ans[i][j] == '*') ans[i][j] = c;
      cout << leng << "\n";
      for (int i = 0; i < leng; i++) cout << ans[i] << "\n";
      exit(0);
      return 1;
    }
  }
  return 0;
}
void init(int n) {
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      if (i == n / i) {
        leng = i;
        all.push_back(make_pair(i, n / i));
      }
    }
  }
}
int main() {
  int sm = 0;
  for (int i = 0; i < 3; i++) {
    scanf("%d%d", &vec[i].first, &vec[i].second);
    sm += vec[i].first * vec[i].second;
    add(vec[i], char('A' + i));
  }
  init(sm);
  if (all.size() == 0) {
    puts("-1");
    exit(0);
  }
  sort(vec.begin(), vec.end());
  do {
    if (solve()) return 0;
  } while (next_permutation(vec.begin(), vec.end()));
  puts("-1");
}
