#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, mi;
int a[8][8], b[8][8], an[8];
char p[4][400010];
inline void D(int x, int y) { a[x][y] = 1; }
inline bool gaosi() {
  int i, j, k;
  for (i = 1; i <= 6; i++) {
    for (j = i; j <= 6; j++)
      if (a[j][i]) {
        for (k = i; k <= 7; k++) swap(a[j][k], a[i][k]);
        break;
      }
    if (!a[i][i]) return 0;
    for (j = 7; j >= i; j--) {
      if (a[i][j] % a[i][i]) return 0;
      a[i][j] /= a[i][i];
    }
    for (j = i + 1; j <= 6; j++)
      if (a[j][i])
        for (k = 7; k >= i; k--) a[j][k] -= a[i][k] * a[j][i];
  }
  for (i = 6; i; i--) {
    for (j = 1; j <= i - 1; j++)
      if (a[j][i]) a[j][7] -= a[i][7];
    if (a[i][7] < 0) return 0;
  }
  return 1;
}
inline void print(int x) {
  int i;
  k++;
  for (i = 0; i <= 3; i++) p[i][k] = (x >> i & 1) + 'a';
}
int main() {
  for (i = 1; i <= 6; i++) scanf("%d", &a[i][7]);
  D(1, 2), D(1, 4), D(1, 5), D(1, 6);
  D(2, 1), D(2, 3), D(2, 5), D(2, 6);
  D(3, 3), D(3, 4), D(3, 6);
  D(4, 1), D(4, 2), D(4, 3), D(4, 4);
  D(5, 2), D(5, 3), D(5, 5);
  D(6, 1), D(6, 4), D(6, 5);
  memcpy(b, a, sizeof(b));
  mi = 1000000000;
  for (i = 0; i <= 400010 - 1; i++) {
    memcpy(a, b, sizeof(a));
    a[3][7] -= i, a[5][7] -= i, a[6][7] -= i;
    if (gaosi()) {
      int s = i;
      for (j = 1; j <= 6; j++) s += a[j][7];
      if (s < mi) {
        mi = s;
        an[0] = i;
        for (j = 1; j <= 6; j++) an[j] = a[j][7];
      }
    }
  }
  if (mi == 1000000000)
    printf("-1\n");
  else {
    swap(an[2], an[3]);
    printf("%d\n", mi);
    for (i = 0; i <= 6; i++)
      for (j = 1; j <= an[i]; j++) print(i + 1);
    for (i = 3; i >= 0; i--) printf("%s\n", p[i] + 1);
  }
  return 0;
}
