#include <bits/stdc++.h>
using namespace std;
bool isSq(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int x1 = a.first, x2 = b.first, x3 = c.first, y1 = a.second, y2 = b.second,
      y3 = c.second;
  if (x1 + x2 + x3 == y1 && x1 + x2 + x3 == y2 && x1 + x2 + x3 == y3) {
    cout << y1 << "\n";
    for (int i = 0; i < y1; ++i) {
      for (int j = 0; j < x1; ++j) cout << 'A';
      for (int j = 0; j < x2; ++j) cout << 'B';
      for (int j = 0; j < x3; ++j) cout << 'C';
      cout << "\n";
    }
    return true;
  } else if (x1 + x2 == x3 && y1 == y2 && y1 + y3 == x3) {
    cout << x3 << "\n";
    for (int i = 0; i < y1; ++i) {
      for (int j = 0; j < x1; ++j) cout << 'A';
      for (int j = 0; j < x2; ++j) cout << 'B';
      cout << "\n";
    }
    for (int i = 0; i < y3; ++i) {
      for (int j = 0; j < x3; ++j) cout << 'C';
      cout << "\n";
    }
    return true;
  } else if (x1 + x3 == x2 && y1 == y3 && y1 + y2 == x2) {
    cout << x2 << "\n";
    for (int i = 0; i < y1; ++i) {
      for (int j = 0; j < x1; ++j) cout << 'A';
      for (int j = 0; j < x3; ++j) cout << 'C';
      cout << "\n";
    }
    for (int i = 0; i < y2; ++i) {
      for (int j = 0; j < x2; ++j) cout << 'B';
      cout << "\n";
    }
    return true;
  } else if (x3 + x2 == x1 && y3 == y2 && y1 + y3 == x1) {
    cout << x1 << "\n";
    for (int i = 0; i < y2; ++i) {
      for (int j = 0; j < x2; ++j) cout << 'B';
      for (int j = 0; j < x3; ++j) cout << 'C';
      cout << "\n";
    }
    for (int i = 0; i < y1; ++i) {
      for (int j = 0; j < x1; ++j) cout << 'A';
      cout << "\n";
    }
    return true;
  }
  return false;
}
int main(int argc, const char* argv[]) {
  pair<int, int> p1[2], p2[2], p3[2];
  int x, y;
  cin >> x >> y;
  p1[0] = make_pair(x, y);
  p1[1] = make_pair(y, x);
  cin >> x >> y;
  p2[0] = make_pair(x, y);
  p2[1] = make_pair(y, x);
  cin >> x >> y;
  p3[0] = make_pair(x, y);
  p3[1] = make_pair(y, x);
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2; ++k) {
        if (isSq(p1[i], p2[j], p3[k])) return 0;
      }
  cout << -1;
  return 0;
}
