#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXM = 1e5;
int h[10][10];
int main() {
  for (int i = 1; i <= 4; i++)
    for (int j = i + 1; j <= 4; j++) scanf("%d", &h[j][i]);
  int p = h[2][1];
  int a1, a2, a3;
  int tp = p + h[3][1] - h[3][2];
  if (tp & 1 || tp < 0) {
    printf("-1");
    return 0;
  }
  a1 = tp / 2;
  a2 = p - a1;
  a3 = h[3][1] - a1;
  int x1, x2, x3, x4, x5, x6, x7;
  x7 = 0;
  int tp1 = h[4][2] + h[4][3] - (a2 + a3);
  int tp2 = h[4][2] + h[4][1] - (a1 + a2);
  if ((tp1 & 1) || (tp2 & 1) || tp1 < 0 || tp2 < 0) {
    printf("-1\n");
    return 0;
  }
  tp1 = tp1 / 2;
  tp2 = tp2 / 2;
  bool flag = true;
  while (true) {
    x2 = tp1 - x7;
    x5 = tp2 - x7;
    if (x2 < 0 || x5 < 0) {
      flag = false;
      break;
    }
    if (x2 > a1 || x5 > a3) {
      x7++;
      continue;
    }
    x1 = a1 - x2;
    x6 = a3 - x5;
    x3 = h[4][1] - x7 - x1 - x5;
    x4 = a2 - x3;
    if (x3 < 0 || x3 > a2) {
      x7++;
      continue;
    }
    break;
  }
  if (!flag) {
    printf("-1\n");
    return 0;
  } else {
    int len = a1 + a2 + a3 + x7;
    printf("%d\n", len);
    for (int i = 1; i <= len; i++) printf("a");
    printf("\n");
    for (int i = 1; i <= p; i++) printf("b");
    for (int i = 1; i <= len - p; i++) printf("a");
    printf("\n");
    for (int i = 1; i <= a1; i++) printf("b");
    for (int i = 1; i <= a2; i++) printf("a");
    for (int i = 1; i <= a3; i++) printf("b");
    for (int i = 1; i <= x7; i++) printf("a");
    printf("\n");
    for (int i = 1; i <= x1; i++) printf("b");
    for (int i = 1; i <= x2; i++) printf("a");
    for (int i = 1; i <= x3; i++) printf("b");
    for (int i = 1; i <= x4; i++) printf("a");
    for (int i = 1; i <= x5; i++) printf("b");
    for (int i = 1; i <= x6; i++) printf("a");
    for (int i = 1; i <= x7; i++) printf("b");
    printf("\n");
  }
  return 0;
}
