#include <bits/stdc++.h>
using namespace std;
const int MAX = 33;
double a[6][7] = {
    {0, 0, 0, 1, 1, 1, 1}, {0, 1, 1, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 0, 1},
    {0, 1, 1, 1, 1, 0, 0}, {1, 0, 1, 1, 0, 1, 0}, {1, 1, 0, 0, 1, 1, 0},
};
int b[6];
int r[7];
int aux[6];
double mat[6][7];
int solve(int v) {
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 6; ++j) mat[i][j] = a[i][j];
    mat[i][6] = b[i] - a[i][6] * v;
  }
  for (int i = 0; i < 6; ++i) {
    int p = i;
    for (int j = i + 1; j < 6; ++j)
      if (abs(mat[j][i]) > abs(mat[p][i])) p = j;
    swap(mat[p], mat[i]);
    if (abs(mat[i][i]) < 1e-6) return 1 << 30;
    for (int j = i + 1; j <= 6; ++j) mat[i][j] /= mat[i][i];
    for (int j = 0; j < 6; ++j)
      if (i != j) {
        double tmp = mat[j][i];
        for (int k = i + 1; k <= 6; ++k) mat[j][k] -= tmp * mat[i][k];
      }
  }
  int total = 0;
  for (int i = 0; i < 6; ++i) {
    double tmp = mat[i][6];
    if (tmp < 0 || abs(tmp - (int)(tmp + 1e-6)) > 1e-6) return 1 << 30;
    aux[i] = (int)(tmp + 1e-6);
    total += aux[i];
  }
  return total + v;
}
int main() {
  int big = 0;
  for (int i = 0; i < 6; ++i) {
    scanf("%d", b + i);
    big = max(big, b[i]);
  }
  int ret = 1 << 30;
  for (int i = 0; i <= big; ++i) {
    int v = solve(i);
    if (v < ret) {
      for (int j = 0; j < 6; ++j) r[j] = aux[j];
      r[6] = i;
      ret = v;
    }
  }
  if (ret == (1 << 30))
    puts("-1");
  else {
    printf("%d\n", ret);
    for (int i = 0; i < 4; ++i) {
      for (int j = 1; j <= 7; ++j) {
        int cnt = r[j - 1];
        while (cnt--) printf("%c", ((j & (1 << (3 - i)))) ? 'a' : 'b');
      }
      printf("\n");
    }
  }
  return 0;
}
