#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int prime = 9241;
const long double pi = acos(-1.);
long double fgauss[11][17];
long double solution[11];
int best[11];
int bestsum;
int main() {
  for (int i = 0; i < 6; i++) cin >> fgauss[i][7];
  for (int i = 1; i < 8; i++) {
    int p = 0;
    for (int j = 0; j < 3; j++)
      for (int k = j + 1; k < 4; k++)
        fgauss[p++][i - 1] =
            ((bool(i & (1 << j))) ^ (bool(i & (1 << k)))) ? 1. : 0.;
  }
  for (int r = 0, c = 0; c < 7; c++) {
    int maxi = r;
    for (int i = r + 1; i < 6; i++)
      if (fgauss[i][c] > fgauss[maxi][c]) maxi = i;
    if (fgauss[maxi][c] < 1e-9) continue;
    for (int i = 0; i <= 7; i++) swap(fgauss[r][i], fgauss[maxi][i]);
    for (int i = 0; i < 6; i++)
      if (i != r)
        for (int j = 7; j >= c; j--)
          fgauss[i][j] -= fgauss[r][j] * fgauss[i][c] / fgauss[r][c];
    r++;
  }
  bestsum = (int)1e9;
  for (int a = 0; a <= 100005; a++) {
    for (int i = 0; i < 6; i++)
      solution[i] =
          (fgauss[i][7] - (long double)a * fgauss[i][6]) / fgauss[i][i];
    bool ok = 1;
    int sum = 0;
    for (int i = 0; i < 6; i++) {
      if (solution[i] - (long double)(int)(0.1 + solution[i]) > 1e-9 ||
          solution[i] < -1e-9)
        ok = 0;
      sum += (int)solution[i];
    }
    solution[6] = a;
    sum += a;
    if (ok && sum < bestsum) {
      bestsum = sum;
      for (int i = 0; i <= 6; i++) best[i] = (int)solution[i];
    }
  }
  if (bestsum >= (int)1e9)
    cout << -1 << endl;
  else {
    printf("%d\n", bestsum);
    for (int i = 0; i < 4; i++) {
      for (int j = 1; j < 8; j++) {
        for (int k = 0; k < best[j - 1]; k++)
          if (j & (1 << i))
            printf("a");
          else
            printf("b");
      }
      printf("\n");
    }
  }
}
