#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
const int inf = 0x3f3f3f3f;
struct com {
  int x, y;
} f[10], g[10];
bool flag;
void work(int i, int j, int k) {
  if (f[i].y == f[j].y + f[k].y && f[j].x == f[k].x &&
      f[i].x + f[j].x == f[i].y) {
    printf("%d\n", f[i].y);
    for (int l = 0; l < f[i].y; l++) {
      for (int r = 0; r < f[i].y; r++) {
        if (r < f[i].x)
          printf("%c", 'A' + i);
        else {
          if (l < f[j].y)
            printf("%c", 'A' + j);
          else
            printf("%c", 'A' + k);
        }
      }
      printf("\n");
    }
    flag = 1;
  }
}
void dfs(int i, int j, int k) {
  if (flag) return;
  work(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work(i, j, k);
  if (flag) return;
  swap(f[j].x, f[j].y);
  work(i, j, k);
  if (flag) return;
  swap(f[k].x, f[k].y);
  work(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work(i, j, k);
  if (flag) return;
  swap(f[j].x, f[j].y);
  work(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  swap(f[j].x, f[j].y);
  swap(f[k].x, f[k].y);
  work(i, j, k);
}
void work1(int i, int j, int k) {
  if (f[i].y == f[j].y && f[j].y == f[k].y &&
      f[i].x + f[j].x + f[k].x == f[i].y) {
    flag = 1;
    printf("%d\n", f[i].y);
    for (int l = 0; l < f[i].y; l++) {
      for (int r = 0; r < f[i].y; r++) {
        if (l < f[i].x)
          printf("%c", 'A' + i);
        else if (l >= f[i].x + f[j].x)
          printf("%c", 'A' + k);
        else
          printf("%c", 'A' + j);
      }
      printf("\n");
    }
  }
}
void bfs(int i, int j, int k) {
  if (flag) return;
  work1(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[j].x, f[j].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[k].x, f[k].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[j].x, f[j].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  work1(i, j, k);
  if (flag) return;
  swap(f[i].x, f[i].y);
  swap(f[j].x, f[j].y);
  swap(f[k].x, f[k].y);
  work1(i, j, k);
}
int main() {
  for (int i = 0; i < 3; i++) scanf("%d%d", &g[i].x, &g[i].y);
  flag = 0;
  for (int i = 0; i < 3; i++) f[i] = g[i];
  dfs(0, 1, 2);
  for (int i = 0; i < 3; i++) f[i] = g[i];
  dfs(1, 0, 2);
  for (int i = 0; i < 3; i++) f[i] = g[i];
  dfs(2, 0, 1);
  if (!flag) {
    for (int i = 0; i < 3; i++) f[i] = g[i];
    bfs(0, 1, 2);
  }
  if (!flag) printf("-1\n");
  return 0;
}
