#include <bits/stdc++.h>
using namespace std;
inline void setmin(int &x, int y) {
  if (y < x) x = y;
}
inline void setmax(int &x, int y) {
  if (y > x) x = y;
}
inline void setmin(long long &x, long long y) {
  if (y < x) x = y;
}
inline void setmax(long long &x, long long y) {
  if (y > x) x = y;
}
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  char c1 = 'A', c2 = 'B', c3 = 'C';
  int d = sqrt(x1 * y1 + x2 * y2 + x3 * y3);
  if (!(d * d == x1 * y1 + x2 * y2 + x3 * y3)) {
    cout << -1 << "\n";
    return 0;
  }
  if (x1 > y1) swap(x1, y1);
  if (x2 > y2) swap(x2, y2);
  if (x3 > y3) swap(x3, y3);
  if (y1 < y2) {
    swap(x1, x2);
    swap(y1, y2);
    swap(c1, c2);
  }
  if (y2 < y3) {
    swap(x2, x3);
    swap(y2, y3);
    swap(c2, c3);
  }
  if (y1 < y2) {
    swap(x1, x2);
    swap(y1, y2);
    swap(c1, c2);
  }
  if (y1 != d) {
    cout << -1 << "\n";
    return 0;
  }
  if (y2 == d && y3 == d) {
    cout << d << "\n";
    for (int i = 0; i < x1; i++) {
      for (int j = 0; j < y1; j++) cout << c1;
      cout << "\n";
    }
    for (int i = 0; i < x2; i++) {
      for (int j = 0; j < y2; j++) cout << c2;
      cout << "\n";
    }
    for (int i = 0; i < x3; i++) {
      for (int j = 0; j < y3; j++) cout << c3;
      cout << "\n";
    }
  } else {
    if (x2 != d - x1) swap(x2, y2);
    if (x3 != d - x1) swap(x3, y3);
    if (x2 != d - x1 || x3 != d - x1) {
      cout << -1 << "\n";
      return 0;
    }
    cout << d << "\n";
    for (int i = 0; i < x1; i++) {
      for (int j = 0; j < y1; j++) cout << c1;
      cout << "\n";
    }
    for (int i = 0; i < d - x1; i++) {
      for (int j = 0; j < d; j++) cout << (j < y2 ? c2 : c3);
      cout << "\n";
    }
  }
  return 0;
}
