#include <bits/stdc++.h>
double EPS = 1E-9;
using namespace std;
bool comp(unsigned long long a, unsigned long long b) {
  int aa = 10 - a % 10;
  int bb = 10 - b % 10;
  return aa < bb;
}
struct rec {
  int x, y;
  int xoff, yoff;
  bool rot;
  bool sides[2];
  char ch;
};
rec recs[3];
int getx(rec r) { return r.x * (1 - r.rot) + r.y * r.rot; }
int gety(rec r) { return r.y * (1 - r.rot) + r.x * r.rot; }
bool F(int ind) {
  bool f = false;
  if (ind == 3) {
    int xx = max(getx(recs[0]), max(getx(recs[1]) + recs[1].xoff,
                                    getx(recs[2]) + recs[2].xoff));
    int yy = max(gety(recs[0]), max(gety(recs[1]) + recs[1].yoff,
                                    gety(recs[2]) + recs[2].yoff));
    if (xx == yy) {
      int sqrecs = 0;
      bool a[300][300];
      memset(a, 0, sizeof(a));
      for (int i = 0; i < 3; i++) sqrecs += recs[i].x * recs[i].y;
      for (int i = 0; sqrecs > 0 && i < xx; i++)
        for (int j = 0; sqrecs > 0 && j < yy; j++) {
          for (int k = 0; k < 3; k++) {
            if (j >= recs[k].xoff && j < recs[k].xoff + getx(recs[k]) &&
                i >= recs[k].yoff && i < recs[k].yoff + gety(recs[k])) {
              if (a[i][j])
                sqrecs = 0;
              else
                a[i][j] = true;
            }
          }
        }
      if (sqrecs == xx * xx) return true;
      return false;
    }
    return false;
  }
  int j;
  for (int i = ind; i < 3; i++) {
    for (j = 0; j < ind; j++) {
      if (recs[j].sides[0] == false) {
        recs[i].xoff = getx(recs[j]) + recs[j].xoff;
        recs[i].yoff = recs[j].yoff;
        recs[j].sides[0] = true;
        f = F(ind + 1);
        if (f) break;
        recs[i].rot = true;
        f = F(ind + 1);
        if (f) break;
        recs[j].sides[0] = false;
        recs[i].xoff = recs[i].yoff = 0;
        recs[i].rot = false;
      }
      if (recs[j].sides[1] == false) {
        recs[i].rot = true;
        recs[j].sides[1] = true;
        recs[i].yoff = gety(recs[j]) + recs[j].yoff;
        recs[i].xoff = recs[j].xoff;
        f = F(ind + 1);
        if (f) break;
        recs[i].rot = false;
        f = F(ind + 1);
        if (f) break;
        recs[i].yoff = recs[i].xoff = 0;
        recs[j].sides[1] = false;
      }
    }
    if (f) break;
  }
  return f;
}
bool BS(unsigned long long key) { return false; }
int main() {
  unsigned long long n;
  const int count = 100;
  int a[6];
  while (cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] >> a[5]) {
    recs[0].x = a[0];
    recs[0].y = a[1];
    recs[0].xoff = 0;
    recs[0].yoff = 0;
    recs[0].rot = false;
    recs[0].ch = 'A';
    recs[1].x = a[2];
    recs[1].y = a[3];
    recs[1].xoff = 0;
    recs[1].yoff = 0;
    recs[1].rot = false;
    recs[1].ch = 'B';
    recs[2].x = a[4];
    recs[2].y = a[5];
    recs[2].xoff = 0;
    recs[2].yoff = 0;
    recs[2].rot = false;
    recs[2].ch = 'C';
    for (int i = 0; i < 6; i++) recs[i / 2].sides[i % 2] = false;
    bool found = false;
    for (int tt = 0; tt < 6; tt++) {
      rec rr = recs[0];
      recs[0] = recs[tt / 2];
      recs[tt / 2] = rr;
      if (tt % 2 == 1)
        recs[0].rot = true;
      else
        recs[0].rot = false;
      found = F(1);
      if (found) {
        char prin[100][100];
        memset(prin, 0, sizeof(prin));
        for (int i = 0; i < 3; i++) {
          for (int j = recs[i].xoff; j < getx(recs[i]) + recs[i].xoff; j++) {
            for (int k = recs[i].yoff; k < gety(recs[i]) + recs[i].yoff; k++) {
              prin[k][j] = recs[i].ch;
            }
          }
        }
        int sum = 0;
        int i = 0;
        while (i < 3) sum += recs[i].x * recs[i++].y;
        cout << sqrt(sum * 1.0) << endl;
        for (int i = 0; i < 100; i++) {
          bool printed = false;
          for (int j = 0; j < 100; j++) {
            if (prin[i][j] >= 'A' && prin[i][j] <= 'C') {
              cout << prin[i][j];
              printed = true;
            }
          }
          if (printed) cout << endl;
        }
        break;
      }
    }
    if (!found) cout << -1 << endl;
  }
  return 0;
}
