#include <bits/stdc++.h>
using namespace std;
int mat[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 aux[6][7];
int res[7];
bool solve() {
  int p, div;
  for (int i = 0; i < 6; ++i) {
    p = i;
    for (int j = i + 1; j < 6; ++j)
      if (abs(aux[j][i]) > abs(aux[p][i])) p = j;
    for (int j = 0; j <= 6; ++j) swap(aux[i][j], aux[p][j]);
    div = aux[i][i];
    for (int k = i; k <= 6; ++k) {
      if (aux[i][k] % div != 0) return 0;
      aux[i][k] /= div;
    }
    for (int j = i + 1; j < 6; ++j) {
      div = aux[j][i];
      for (int k = i; k <= 6; ++k) aux[j][k] -= div * aux[i][k];
    }
  }
  for (int i = 6 - 1; i >= 0; --i) {
    res[i] = aux[i][6];
    for (int k = 6 - 1; k > i; --k) res[i] -= res[k] * aux[i][k];
  }
  return 1;
}
int main() {
  int big = 0;
  for (int i = 0; i < 6; ++i)
    scanf("%d", &mat[i][6]), big = max(big, mat[i][6]);
  bool g = 0;
  for (int i = 0; i <= big && !g; ++i) {
    memcpy(aux, mat, sizeof aux);
    for (int j = 0; j < 3; ++j) aux[j][6] -= i;
    g = solve();
    for (int j = 0; j < 6 && g; ++j)
      if (res[j] < 0) g = 0;
    res[6] = i;
    int a = 0;
    for (int i = 0; i < 7; ++i) a += res[i];
    if (!g) continue;
    printf("%d\n", a);
    for (int j = 3; j >= 0; --j) {
      for (int i = 0; i < 7; ++i) {
        char b = 'a';
        if ((i + 1) & 1 << j) b = 'b';
        for (int k = 0; k < res[i]; ++k) printf("%c", b);
      }
      printf("\n");
    }
  }
  if (!g) printf("-1\n");
  return 0;
}
