#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
int n;
vector<vector<char> > s;
int mark[3];
int f(int id, int b, vector<int> &v) {
  if (id == 3) {
    if (b == 0) {
      int add = 0;
      for (int i = (0); i < (3); ++i) {
        if (v[i] == 0) {
          for (int j = (0); j < (y[i]); ++j)
            for (int k = (0); k < (x[i]); ++k) s[j][k + add] = 'A' + i;
          add += x[i];
        } else {
          for (int j = (0); j < (x[i]); ++j)
            for (int k = (0); k < (y[i]); ++k) s[j][k + add] = 'A' + i;
          add += y[i];
        }
      }
      return 1;
    } else
      return 0;
  }
  if (y[id] == n) {
    v.push_back(0);
    if (f(id + 1, b - x[id], v)) return 1;
    v.pop_back();
  }
  if (x[id] == n) {
    v.push_back(1);
    if (f(id + 1, b - y[id], v)) return 1;
    v.pop_back();
  }
  return 0;
}
int g(int id, int a, int b, vector<int> &v, vector<pair<int, int> > &vv) {
  if (id == 3) {
    if (a == 0 && b == 0) {
      for (int i = (0); i < (vv[0].first); ++i)
        for (int j = (0); j < (vv[0].second); ++j) s[i][j] = 'A' + v[0];
      for (int i = (0); i < (vv[1].first); ++i)
        for (int j = (0); j < (vv[1].second); ++j)
          s[i][vv[0].second + j] = 'A' + v[1];
      for (int i = (0); i < (vv[2].first); ++i)
        for (int j = (0); j < (vv[2].second); ++j)
          s[i + vv[1].first][vv[0].second + j] = 'A' + v[2];
      return 1;
    } else
      return 0;
  }
  if (id == 0) {
    for (int i = (0); i < (3); ++i) {
      if (x[i] == n) {
        v.push_back(i);
        mark[i] = 1;
        vv.push_back(make_pair(x[i], y[i]));
        if (g(id + 1, n, b - y[i], v, vv) == 1) return 1;
        vv.pop_back();
        v.pop_back();
        mark[i] = 0;
      } else if (y[i] == n) {
        v.push_back(i);
        mark[i] = 1;
        vv.push_back(make_pair(y[i], x[i]));
        if (g(id + 1, n, b - x[i], v, vv) == 1) return 1;
        vv.pop_back();
        mark[i] = 0;
        v.pop_back();
      }
    }
    return 0;
  } else {
    for (int i = (0); i < (3); ++i) {
      if (!mark[i]) {
        if (x[i] == b && (id == 1 ? y[i] < a : y[i] == a)) {
          v.push_back(i);
          mark[i] = 1;
          vv.push_back(make_pair(y[i], x[i]));
          if (g(id + 1, a - y[i], id == 2 ? b - x[i] : b, v, vv) == 1) return 1;
          vv.pop_back();
          v.pop_back();
          mark[i] = 0;
        } else if (y[i] == b && (id == 1 ? x[i] < a : x[i] == a)) {
          v.push_back(i);
          mark[i] = 1;
          vv.push_back(make_pair(x[i], y[i]));
          if (g(id + 1, a - x[i], id == 2 ? b - y[i] : b, v, vv) == 1) return 1;
          vv.pop_back();
          mark[i] = 0;
          v.pop_back();
        }
      }
    }
    return 0;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  for (int i = (0); i < (3); ++i) cin >> x[i] >> y[i];
  int area = 0;
  for (int i = (0); i < (3); ++i) area += x[i] * y[i];
  n = (int)sqrt(area);
  int fl = 0;
  if (n * n == area) {
    fl = 1;
  } else if ((n + 1) * (n + 1) == area) {
    fl = 1;
    n++;
  } else if ((n - 1) * (n - 1) == area) {
    fl = 1;
    n--;
  }
  for (int i = (0); i < (3); ++i) {
    if (x[i] > n || y[i] > n) {
      fl = 0;
      break;
    }
  }
  if (!fl)
    cout << "-1";
  else {
    vector<int> v;
    s.resize(n);
    fl = 0;
    for (int i = (0); i < (n); ++i) s[i].resize(n);
    if (f(0, n, v)) {
      fl = 1;
    } else {
      vector<pair<int, int> > vv;
      v.clear();
      if (g(0, n, n, v, vv)) fl = 1;
    }
    if (!fl)
      cout << -1;
    else {
      cout << n << endl;
      for (int i = (0); i < (n); ++i) {
        for (int j = (0); j < (n); ++j) {
          cout << s[i][j];
        }
        cout << endl;
      }
    }
  }
  return 0;
}
