#include <bits/stdc++.h>
using namespace std;
int v[3][2];
char Sym[]{'A', 'B', 'C'};
bool Case1(int a, int a1, int b, int b1, int c, int c1) {
  if (v[a][a1] == v[b][b1] && v[a][a1] == v[c][c1]) {
    if (v[a][!a1] + v[b][!b1] + v[c][!c1] == v[a][a1]) return true;
  }
  return false;
}
bool Case2(int a, int a1, int b, int b1, int c, int c1) {
  if (v[a][a1] == v[b][b1] + v[c][c1]) {
    if (v[a][!a1] + v[b][!b1] == v[a][a1] && v[b][!b1] == v[c][!c1])
      return true;
  }
  return false;
}
void paint1(int a, int a1, int b, int b1, int c, int c1) {
  cout << v[a][a1] << endl;
  for (int i = 0; i < v[a][!a1]; i++) {
    for (int j = 0; j < v[a][a1]; j++) {
      cout << Sym[a];
    }
    cout << endl;
  }
  for (int i = 0; i < v[b][!b1]; i++) {
    for (int j = 0; j < v[b][b1]; j++) {
      cout << Sym[b];
    }
    cout << endl;
  }
  for (int i = 0; i < v[c][!c1]; i++) {
    for (int j = 0; j < v[c][c1]; j++) {
      cout << Sym[c];
    }
    cout << endl;
  }
}
void paint2(int a, int a1, int b, int b1, int c, int c1) {
  cout << v[a][a1] << endl;
  for (int i = 0; i < v[a][!a1]; i++) {
    for (int j = 0; j < v[a][a1]; j++) {
      cout << Sym[a];
    }
    cout << endl;
  }
  for (int i = 0; i < v[b][!b1]; i++) {
    for (int j = 0; j < v[b][b1]; j++) {
      cout << Sym[b];
    }
    for (int j = 0; j < v[c][c1]; j++) {
      cout << Sym[c];
    }
    cout << endl;
  }
}
int main() {
  for (int i = 0; i < 3; i++) cin >> v[i][0] >> v[i][1];
  for (int i = 0; i < 3; i++) {
    for (int i1 = 0; i1 < 2; i1++) {
      for (int j = 0; j < 3; j++) {
        if (i == j) continue;
        for (int j1 = 0; j1 < 2; j1++) {
          for (int k = 0; k < 3; k++) {
            if (i == k || j == k) continue;
            for (int k1 = 0; k1 < 2; k1++) {
              if (Case1(i, i1, j, j1, k, k1)) {
                paint1(i, i1, j, j1, k, k1);
                return 0;
              }
              if (Case2(i, i1, j, j1, k, k1)) {
                paint2(i, i1, j, j1, k, k1);
                return 0;
              }
            }
          }
        }
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
