#include <bits/stdc++.h>
using namespace std;
int R[5], C[5];
int r[5], c[5];
int flag[5];
int ans, f;
bool check() {
  for (int i = 1; i <= 3; i++) {
    r[i] = R[i], c[i] = C[i];
    if (flag[i] == 1) swap(r[i], c[i]);
  }
  if (r[1] + r[2] + r[3] == c[1]) {
    printf("%d\n", c[1]);
    for (int i = 1; i <= r[1]; i++) {
      for (int j = 1; j <= c[1]; j++) printf("A");
      printf("\n");
    }
    for (int i = 1; i <= r[2]; i++) {
      for (int j = 1; j <= c[2]; j++) printf("B");
      printf("\n");
    }
    for (int i = 1; i <= r[3]; i++) {
      for (int j = 1; j <= c[3]; j++) printf("C");
      printf("\n");
    }
    return 1;
  }
  if (r[2] == r[3] && c[1] == c[2] + c[3] && c[1] == r[1] + r[2]) {
    printf("%d\n", c[1]);
    for (int i = 1; i <= r[1]; i++) {
      for (int j = 1; j <= c[1]; j++) printf("A");
      printf("\n");
    }
    for (int i = 1; i <= r[2]; i++) {
      for (int j = 1; j <= c[2]; j++) printf("B");
      for (int j = 1; j <= c[3]; j++) printf("C");
      printf("\n");
    }
    return 1;
  }
  if (r[1] == r[3] && c[2] == c[1] + c[3] && c[2] == r[1] + r[2]) {
    printf("%d\n", c[2]);
    for (int i = 1; i <= r[2]; i++) {
      for (int j = 1; j <= c[2]; j++) printf("B");
      printf("\n");
    }
    for (int i = 1; i <= r[1]; i++) {
      for (int j = 1; j <= c[1]; j++) printf("A");
      for (int j = 1; j <= c[3]; j++) printf("C");
      printf("\n");
    }
    return 1;
  }
  if (r[1] == r[2] && c[3] == c[1] + c[2] && c[3] == r[1] + r[3]) {
    printf("%d\n", c[3]);
    for (int i = 1; i <= r[3]; i++) {
      for (int j = 1; j <= c[3]; j++) printf("C");
      printf("\n");
    }
    for (int i = 1; i <= r[1]; i++) {
      for (int j = 1; j <= c[1]; j++) printf("A");
      for (int j = 1; j <= c[2]; j++) printf("B");
      printf("\n");
    }
    return 1;
  }
  return 0;
}
void dfs(int now) {
  if (now == 4) {
    if (f == 1) return;
    if (check() == 1) f = 1;
    return;
  }
  flag[now] = 0;
  dfs(now + 1);
  flag[now] = 1;
  dfs(now + 1);
}
int main() {
  for (int i = 1; i <= 3; i++) scanf("%d%d", &R[i], &C[i]);
  f = 0;
  dfs(1);
  if (f == 0) printf("-1\n");
  return 0;
}
