#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
} re[5];
char ans[400][400];
char trs(int x) { return x - 1 + 'A'; }
int main() {
  cin >> re[1].x >> re[1].y >> re[2].x >> re[2].y >> re[3].x >> re[3].y;
  int maxn = 0, bs;
  for (int i = 1; i <= 3; i++) {
    if (re[i].x > re[i].y) swap(re[i].x, re[i].y);
    if (re[i].y > maxn) {
      maxn = re[i].y;
      bs = i;
    }
  }
  int a, b;
  if (bs == 1) {
    a = 2;
    b = 3;
  } else if (bs == 2) {
    a = 1;
    b = 3;
  } else {
    a = 1;
    b = 2;
  }
  if (re[a].x == re[b].x) {
    if (re[a].x + re[bs].x == re[bs].y && re[a].y + re[b].y == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (int i = re[bs].x; i < re[bs].x + re[a].x; i++) {
        int j;
        for (j = 0; j < re[a].y; j++) ans[i][j] = trs(a);
        for (; j < re[a].y + re[b].y; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    }
  }
  if (re[a].x == re[b].y) {
    if (re[a].x + re[bs].x == re[bs].y && re[a].y + re[b].x == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (int i = re[bs].x; i < re[bs].x + re[a].x; i++) {
        int j;
        for (j = 0; j < re[a].y; j++) ans[i][j] = trs(a);
        for (; j < re[a].y + re[b].x; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    } else if (re[a].x == re[bs].y &&
               re[a].y + re[b].x + re[bs].x == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[bs].x; i < re[a].y + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[a].x; j++) ans[i][j] = trs(a);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[a].y + re[bs].x; i < re[b].x + re[a].y + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[b].y; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    }
  }
  if (re[a].y == re[b].x) {
    if (re[a].y + re[bs].x == re[bs].y && re[a].x + re[b].y == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (int i = re[bs].x; i < re[bs].x + re[a].y; i++) {
        int j;
        for (j = 0; j < re[a].x; j++) ans[i][j] = trs(a);
        for (; j < re[a].x + re[b].y; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    } else if (re[a].y == re[bs].y &&
               re[a].x + re[b].y + re[bs].x == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[bs].x; i < re[a].x + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[a].y; j++) ans[i][j] = trs(a);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[a].x + re[bs].x; i < re[b].y + re[a].x + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[b].x; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    }
  }
  if (re[a].y == re[b].y) {
    if (re[a].y + re[bs].x == re[bs].y && re[a].x + re[b].x == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (int i = re[bs].x; i < re[bs].x + re[a].y; i++) {
        int j;
        for (j = 0; j < re[a].x; j++) ans[i][j] = trs(a);
        for (; j < re[a].x + re[b].x; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    } else if (re[a].y == re[bs].y &&
               re[a].x + re[b].x + re[bs].x == re[bs].y) {
      printf("%d\n", maxn);
      int i;
      for (i = 0; i < re[bs].x; i++) {
        int j;
        for (j = 0; j < re[bs].y; j++) ans[i][j] = trs(bs);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[bs].x; i < re[a].x + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[a].y; j++) ans[i][j] = trs(a);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      for (i = re[a].x + re[bs].x; i < re[b].x + re[a].x + re[bs].x; i++) {
        int j;
        for (j = 0; j < re[b].y; j++) ans[i][j] = trs(b);
        ans[i][j] = '\0';
        printf("%s\n", ans[i]);
      }
      return 0;
    }
  }
  cout << -1 << endl;
}
