#include <bits/stdc++.h>
using namespace std;
char name[5] = {"ABC"};
int x[5], y[5];
int size;
int s[111][111];
bool used[5];
bool sida;
void input() {
  for (int i = 1; i <= 3; i++) scanf("%d %d", &x[i], &y[i]);
}
bool checkok(int hang, int cot, int ehang, int ecot) {
  if (ehang > size || ecot > size) return 0;
  for (int i = hang; i <= ehang; i++)
    for (int j = cot; j <= ecot; j++)
      if (s[i][j] != 0) return 0;
  return 1;
}
void dien(int hang, int cot, int ehang, int ecot, int val) {
  for (int i = hang; i <= ehang; i++)
    for (int j = cot; j <= ecot; j++) s[i][j] = val;
}
void dequy(int hang, int cot) {
  if (hang > size) {
    for (int i = 1; i <= 3; i++)
      if (used[i] == 0) return;
    sida = 1;
    return;
  }
  if (s[hang][cot] != 0) {
    if (cot == size)
      dequy(hang + 1, 1);
    else
      dequy(hang, cot + 1);
    return;
  }
  for (int i = 1; i <= 3; i++) {
    if (used[i] == 1) continue;
    if (checkok(hang, cot, hang + y[i] - 1, cot + x[i] - 1)) {
      dien(hang, cot, hang + y[i] - 1, cot + x[i] - 1, i);
      used[i] = 1;
      dequy(hang, cot + 1);
      if (sida) return;
      dien(hang, cot, hang + y[i] - 1, cot + x[i] - 1, 0);
      used[i] = 0;
    }
  }
  for (int i = 1; i <= 3; i++) {
    if (used[i] == 1) continue;
    if (checkok(hang, cot, hang + x[i] - 1, cot + y[i] - 1)) {
      dien(hang, cot, hang + x[i] - 1, cot + y[i] - 1, i);
      used[i] = 1;
      dequy(hang, cot + 1);
      if (sida) return;
      dien(hang, cot, hang + x[i] - 1, cot + y[i] - 1, 0);
      used[i] = 0;
    }
  }
}
bool check(int size) {
  for (int i = 1; i <= 3; i++) used[i] = 0;
  sida = 0;
  dequy(1, 1);
  return sida;
}
void output() {
  int i, j;
  printf("%d\n", size);
  for (int i = 1; i <= size; i++) {
    for (int j = 1; j <= size; j++) printf("%c", name[s[i][j] - 1]);
    printf("\n");
  }
}
void solve() {
  for (size = 1; size <= 100; size++) {
    for (int i = 1; i <= size; i++)
      for (int j = 1; j <= size; j++) s[i][j] = 0;
    if (check(size)) {
      output();
      return;
    }
  }
  printf("-1\n");
}
int main() {
  input();
  solve();
  return 0;
}
