#include <bits/stdc++.h>
using namespace std;
int main() {
  int x1, y1, x2, y2, x3, y3;
  char c1 = 'A', c2 = 'B', c3 = 'C';
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  if (x1 > y1) swap(x1, y1);
  if (x2 > y2) swap(x2, y2);
  if (x3 > y3) swap(x3, y3);
  if (y2 > y1) {
    swap(x1, x2);
    swap(y1, y2);
    swap(c1, c2);
  }
  if (y3 > y1) {
    swap(x1, x3);
    swap(y1, y3);
    swap(c1, c3);
  }
  if (y1 == y2 && y2 == y3 && x1 + x2 + x3 == y1) {
    cout << y1 << '\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 (y1 == x1 + y2) swap(x2, y2);
    if (y1 == x1 + y3) swap(x3, y3);
    if (y2 + y3 == y1 && x2 + x1 == y1 && x3 + x1 == y1) {
      cout << y1 << '\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;
        for (int k = 0; k < y3; k++) cout << c3;
        cout << '\n';
      }
    } else {
      cout << -1;
    }
  }
}
