#include <bits/stdc++.h>
using namespace std;
const int N = 10, N0 = 1000010;
int d[N][N], t[N];
double sd[N][N];
bool flag;
void Gauss() {
  for (int i = 1; i <= 6; i++) {
    int p = i;
    for (int j = i + 1; j <= 8; j++)
      if (fabs(sd[j][i]) > fabs(sd[p][i])) p = j;
    for (int j = i; j <= 8; j++) swap(sd[i][j], sd[p][j]);
    for (int j = i + 1; j <= 8; j++) sd[i][j] /= sd[i][i];
    sd[i][i] = 1;
    for (int j = 1; j <= 8; j++)
      if (i != j) {
        double tmp = sd[j][i];
        for (int k = 1; k <= 8; k++) sd[j][k] -= sd[i][k] * tmp;
      }
  }
  for (int i = 1; i <= 6; i++) t[i] = sd[i][8];
  for (int i = 1; i <= 6; i++)
    for (int j = 1; j <= 8; j++) {
      int tmp = sd[i][j];
      if (fabs(tmp - sd[i][j]) > 1e-5) flag = true;
    }
}
char a1[N0], a2[N0], a3[N0], a4[N0];
int a0[N][N] = {{0, 1, 1, 1}, {1, 0, 1, 1}, {1, 1, 0, 1}, {1, 1, 1, 0},
                {0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}};
int main() {
  for (int i = 1; i <= 4; i++)
    for (int j = i + 1; j <= 4; j++) scanf("%d", &d[i][j]);
  sd[1][1] = sd[1][2] = sd[1][6] = sd[1][7] = 1, sd[1][8] = d[1][2];
  sd[2][1] = sd[2][3] = sd[2][5] = sd[2][7] = 1, sd[2][8] = d[1][3];
  sd[3][1] = sd[3][4] = sd[3][5] = sd[3][6] = 1, sd[3][8] = d[1][4];
  sd[4][2] = sd[4][3] = sd[4][5] = sd[4][6] = 1, sd[4][8] = d[2][3];
  sd[5][2] = sd[5][4] = sd[5][5] = sd[5][7] = 1, sd[5][8] = d[2][4];
  sd[6][3] = sd[6][4] = sd[6][6] = sd[6][7] = 1, sd[6][8] = d[3][4];
  Gauss();
  int mx = 1e9, sum = 0, l = 0;
  for (int i = 1; i <= 4; i++) mx = min(mx, t[i]);
  int mx0 = max(-t[5], -t[6]);
  if (mx < mx0 || flag) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= 6; i++) sum += t[i];
  for (int i = 1; i <= 7; i++) {
    int k;
    if (i <= 4)
      k = t[i] - mx;
    else
      k = t[i] + mx;
    for (int j = 1; j <= k; j++) {
      l++;
      a1[l] = 'a' + a0[i - 1][0], a2[l] = 'a' + a0[i - 1][1],
      a3[l] = 'a' + a0[i - 1][2], a4[l] = 'a' + a0[i - 1][3];
    }
  }
  printf("%d\n", sum - mx);
  for (int i = 1; i <= l; i++) printf("%c", a1[i]);
  printf("\n");
  for (int i = 1; i <= l; i++) printf("%c", a2[i]);
  printf("\n");
  for (int i = 1; i <= l; i++) printf("%c", a3[i]);
  printf("\n");
  for (int i = 1; i <= l; i++) printf("%c", a4[i]);
  printf("\n");
  return 0;
}
