#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
int m[205][205];
int r;
void change(int ni, int nj, int x, int y, int c) {
  for (int i = 0; i < x; i++)
    for (int j = 0; j < y; j++) m[ni + i][nj + j] = c;
}
bool dfs(int dis) {
  if (dis == 3) return 1;
  int ni = -1, nj = -1;
  for (int i = 1; i <= r; i++) {
    if (ni != -1) break;
    for (int j = 1; j <= r; j++) {
      if (m[i][j] == 1) {
        ni = i, nj = j;
        break;
      }
    }
  }
  if (ni == -1) return false;
  bool sign = 1;
  for (int i = 0; i < x[dis]; i++) {
    if (!sign) break;
    for (int j = 0; j < y[dis]; j++) {
      if (m[ni + i][nj + j] != 1) {
        sign = 0;
        break;
      }
    }
  }
  if (sign) {
    change(ni, nj, x[dis], y[dis], dis + 'A');
    if (dfs(dis + 1)) return 1;
    change(ni, nj, x[dis], y[dis], 1);
  }
  sign = 1;
  for (int i = 0; i < y[dis]; i++) {
    if (!sign) break;
    for (int j = 0; j < x[dis]; j++) {
      if (m[ni + i][nj + j] != 1) {
        sign = 0;
        break;
      }
    }
  }
  if (sign) {
    change(ni, nj, y[dis], x[dis], dis + 'A');
    if (dfs(dis + 1)) return 1;
    change(ni, nj, y[dis], x[dis], 1);
  }
  return 0;
}
bool solve() {
  if (r == -1) return 0;
  memset(m, 0, sizeof(m));
  for (int i = 1; i <= r; i++)
    for (int j = 1; j <= r; j++) m[i][j] = 1;
  if (dfs(0)) {
    printf("%d\n", r);
    for (int i = 1; i <= r; i++) {
      for (int j = 1; j <= r; j++) {
        printf("%c", m[i][j]);
      }
      puts("");
    }
    return 1;
  }
  return 0;
}
int main() {
  int sum = 0;
  for (int i = 0; i < 3; i++) scanf("%d%d", &x[i], &y[i]);
  for (int i = 0; i < 3; i++) sum += x[i] * y[i];
  r = -1;
  for (int i = 1; i <= 1000; i++) {
    if (i * i == sum) {
      r = i;
      break;
    }
  }
  if (solve()) return 0;
  swap(x[0], x[1]);
  swap(y[0], y[1]);
  if (solve()) return 0;
  swap(x[1], x[2]);
  swap(y[1], y[2]);
  if (solve()) return 0;
  swap(x[0], x[1]);
  swap(y[0], y[1]);
  if (solve()) return 0;
  swap(x[1], x[2]);
  swap(y[1], y[2]);
  if (solve()) return 0;
  swap(x[0], x[1]);
  swap(y[0], y[1]);
  if (solve()) return 0;
  puts("-1");
}
