#include <bits/stdc++.h>
using namespace std;
inline int rit() {
  int x;
  cin >> x;
  return x;
}
int x1, x2, x3, yy, y2, y3;
int sum, len, key;
char maap[200][200];
int put(int sx, int sy, int x, int y, char c) {
  int ex = sx + x - 1, ey = sy + y - 1, i, j;
  if (sx < 0 || ex >= len || sy < 0 || ey >= len) return 0;
  for (i = sx; i <= ex; i++) {
    for (j = sy; j <= ey; j++)
      if (maap[i][j] != '.') break;
    if (j <= ey) break;
  }
  if (i <= ex) return 0;
  for (i = sx; i <= ex; i++) {
    for (j = sy; j <= ey; j++) maap[i][j] = c;
  }
  return 1;
}
void meow() {
  int i, j;
  key = 1;
  cout << len << endl;
  for (i = 0; i < len; i++) {
    for (j = 0; j < len; j++) cout << maap[i][j];
    cout << endl;
  }
}
void clr() {
  memset(maap, '.', sizeof(maap));
  put(0, 0, x1, yy, 'A');
}
void solve() {
  clr();
  if (put(x1, 0, x2, y2, 'B') && put(0, yy, x3, y3, 'C')) {
    meow();
    return;
  }
  clr();
  if (put(x1, 0, x3, y3, 'C') && put(0, yy, x2, y2, 'B')) {
    meow();
    return;
  }
  clr();
  if (put(x1, 0, x2, y2, 'B') && put(x1 + x2, 0, x3, y3, 'C')) {
    meow();
    return;
  }
  clr();
  if (put(x1, 0, x3, y3, 'C') && put(x1 + x3, 0, x2, y2, 'B')) {
    meow();
    return;
  }
  clr();
  if (put(0, yy, x2, y2, 'B') && put(0, yy + y2, x3, y3, 'C')) {
    meow();
    return;
  }
  clr();
  if (put(0, yy, x3, y3, 'C') && put(0, yy + y3, x2, y2, 'B')) {
    meow();
    return;
  }
  clr();
  if (put(x1, 0, x2, y2, 'B') && put(x1, y2, x3, y3, 'C')) {
    meow();
    return;
  }
  clr();
  if (put(x1, 0, x3, y3, 'C') && put(x1, y3, x2, y2, 'B')) {
    meow();
    return;
  }
  clr();
  if (put(0, yy, x2, y2, 'B') && put(x2, yy, x3, y3, 'C')) {
    meow();
    return;
  }
  clr();
  if (put(0, yy, x3, y3, 'C') && put(x3, yy, x2, y2, 'B')) {
    meow();
    return;
  }
  clr();
}
void read() {
  int i, j, k;
  x1 = rit(), yy = rit();
  x2 = rit(), y2 = rit();
  x3 = rit(), y3 = rit();
  sum = x1 * yy;
  sum += x2 * y2;
  sum += x3 * y3;
  len = (int)(sqrt((double)sum + 0.00000001));
  if (len * len == sum) {
    for (i = 0; i < 2; i++, swap(x1, yy)) {
      for (j = 0; j < 2; j++, swap(x2, y2)) {
        for (k = 0; k < 2; k++, swap(x3, y3)) {
          solve();
          if (key) break;
        }
        if (key) break;
      }
      if (key) break;
    }
    if (!key) cout << -1 << endl;
  } else
    cout << -1 << endl;
}
int main() {
  read();
  return 0;
}
