#include <bits/stdc++.h>
using namespace std;
int len, x[1005], y[1005];
char ans[1005][1005];
int main() {
  for (int i = 0; i < 3; i++) {
    scanf("%d%d", &x[i], &y[i]);
    if (x[i] < y[i]) swap(x[i], y[i]);
    len = max(len, x[i]);
  }
  int cnt = 0;
  for (int i = 0; i < 3; i++)
    if (x[i] == len) cnt++;
  if (cnt == 3) {
    if (y[0] + y[1] + y[2] == len) {
      printf("%d\n", len);
      for (int i = 0; i < 3; i++)
        for (int j = 0; j < y[i]; j++) {
          for (int k = 0; k < len; k++) printf("%c", 'A' + i);
          printf("\n");
        }
      return 0;
    } else {
      printf("-1\n");
      return 0;
    }
  }
  bool success = false;
  if (cnt == 1) {
    for (int i = 0; i < 3; i++) {
      if (x[i] == len) {
        int h = len - y[i];
        for (int j = 0; j < y[i]; j++)
          for (int k = 0; k < len; k++) ans[j][k] = 'A' + i;
        int a = x[(i + 1) % 3];
        int b = y[(i + 1) % 3];
        int aa = x[(i + 2) % 3];
        int bb = y[(i + 2) % 3];
        if (a == h) {
          if (aa == h) {
            success = true;
            for (int j = y[i]; j < len; j++) {
              for (int k = 0; k < b; k++) ans[j][k] = 'A' + (i + 1) % 3;
              for (int k = b; k < len; k++) ans[j][k] = 'A' + (i + 2) % 3;
            }
          } else if (bb == h) {
            success = true;
            for (int j = y[i]; j < len; j++) {
              for (int k = 0; k < b; k++) ans[j][k] = 'A' + (i + 1) % 3;
              for (int k = b; k < len; k++) ans[j][k] = 'A' + (i + 2) % 3;
            }
          }
        } else if (b == h) {
          if (aa == h) {
            success = true;
            for (int j = y[i]; j < len; j++) {
              for (int k = 0; k < a; k++) ans[j][k] = 'A' + (i + 1) % 3;
              for (int k = a; k < len; k++) ans[j][k] = 'A' + (i + 2) % 3;
            }
          } else if (bb == h) {
            success = true;
            for (int j = y[i]; j < len; j++) {
              for (int k = 0; k < a; k++) ans[j][k] = 'A' + (i + 1) % 3;
              for (int k = a; k < len; k++) ans[j][k] = 'A' + (i + 2) % 3;
            }
          }
        }
      }
    }
  }
  if (success) {
    printf("%d\n", len);
    for (int i = 0; i < len; i++) {
      for (int j = 0; j < len; j++) printf("%c", ans[i][j]);
      printf("\n");
    }
  } else
    printf("-1\n");
  return 0;
}
