#include <bits/stdc++.h>
using namespace std;
int h[10][10], f[10][10];
int main() {
  int n, tmp, i, t1, t2, t3;
  bool flag;
  scanf("%d%d%d", &h[1][2], &h[1][3], &h[1][4]);
  scanf("%d%d", &h[2][3], &h[2][4]);
  scanf("%d", &h[3][4]);
  for (n = 1; n <= 10000000; n++) {
    f[1][1] = n;
    f[2][1] = n - h[1][2];
    f[2][2] = h[1][2];
    if (f[2][1] < 0 || f[2][2] < 0) continue;
    if (((h[1][3] + h[2][3] - h[1][2]) & 1) == 1) continue;
    f[3][2] = (h[1][3] + h[2][3] - h[1][2]) >> 1;
    if (f[3][2] < 0) continue;
    f[3][1] = n - h[1][2] - f[3][2];
    if (f[3][1] < 0) continue;
    f[3][3] = n - h[1][3] - f[3][1];
    f[3][4] = h[1][3] - f[3][2];
    if (f[3][3] < 0 || f[3][4] < 0) continue;
    t1 = h[1][4] + h[2][4] - f[3][3] - f[3][4];
    if (t1 < 0 || (t1 & 1) == 1) continue;
    t2 = h[1][4] + h[3][4] - f[3][2] - f[3][4];
    if (t2 < 0 || (t2 & 1) == 1) continue;
    t3 = h[2][4] + h[3][4] - f[3][2] - f[3][3];
    if (t3 < 0 || (t3 & 1) == 1) continue;
    for (f[4][1] = 0, flag = false; f[4][1] <= f[3][1]; f[4][1]++) {
      f[4][2] = f[3][1] - f[4][1];
      f[4][4] = (t1 >> 1) - f[4][2];
      if (f[4][4] < 0) continue;
      f[4][3] = f[3][2] - f[4][4];
      if (f[4][3] < 0) continue;
      f[4][6] = (t2 >> 1) - f[4][2];
      if (f[4][6] < 0) continue;
      f[4][5] = f[3][3] - f[4][6];
      if (f[4][5] < 0) continue;
      f[4][7] = (t3 >> 1) - f[4][2];
      if (f[4][7] < 0) continue;
      f[4][8] = f[3][4] - f[4][7];
      if (f[4][8] < 0) continue;
      flag = true;
      break;
    }
    if (flag) break;
  }
  if (n >= 10000000) {
    printf("-1\n");
    return 0;
  }
  printf("%d\n", n);
  for (i = 1; i <= f[1][1]; i++) printf("a");
  printf("\n");
  for (i = 1; i <= f[2][1]; i++) printf("a");
  for (i = 1; i <= f[2][2]; i++) printf("b");
  printf("\n");
  for (i = 1; i <= f[3][1]; i++) printf("a");
  for (i = 1; i <= f[3][2]; i++) printf("b");
  for (i = 1; i <= f[3][3]; i++) printf("a");
  for (i = 1; i <= f[3][4]; i++) printf("b");
  printf("\n");
  for (i = 1; i <= f[4][1]; i++) printf("a");
  for (i = 1; i <= f[4][2]; i++) printf("b");
  for (i = 1; i <= f[4][3]; i++) printf("a");
  for (i = 1; i <= f[4][4]; i++) printf("b");
  for (i = 1; i <= f[4][5]; i++) printf("a");
  for (i = 1; i <= f[4][6]; i++) printf("b");
  for (i = 1; i <= f[4][7]; i++) printf("a");
  for (i = 1; i <= f[4][8]; i++) printf("b");
  printf("\n");
  return 0;
}
