#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
char col[7][4] = {'a', 'a', 'a', 'b', 'a', 'a', 'b', 'a', 'a', 'a',
                  'b', 'b', 'a', 'b', 'a', 'a', 'a', 'b', 'b', 'a',
                  'a', 'b', 'b', 'b', 'a', 'b', 'a', 'b'};
int x[7], f[6][8] = {0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0,
                     1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0,
                     1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0},
          r[6][8];
int smin = inf, rez[7], d[7], rmax, x1[8];
void gauss() {
  int i = 0, j = 0, k, l, sum = rmax;
  while (i < 6 && j < 7) {
    for (k = i; k < 6; ++k)
      if (r[k][j]) break;
    if (k == 6) {
      ++j;
      continue;
    }
    for (l = 0; l < 8; ++l) swap(r[k][l], r[i][l]);
    for (l = j + 1; l < 8; ++l) r[i][l] /= r[i][j];
    r[i][j] = 1;
    for (k = i + 1; k < 6; ++k) {
      for (l = j + 1; l < 8; ++l) r[k][l] -= r[i][l] * r[k][j];
      r[k][j] = 0;
    }
    ++i;
    ++j;
  }
  for (i = 5; i >= 0; --i)
    for (j = 0; j < 8; ++j)
      if (r[i][j]) {
        if (j == 7) return;
        d[j] = r[i][7];
        for (k = j + 1; k < 7; ++k) d[j] -= d[k] * r[i][k];
        if (d[j] < 0) return;
        sum += d[j];
        break;
      }
  if (sum < smin) {
    smin = sum;
    rez[0] = rmax;
    for (i = 1; i < 7; ++i) rez[i] = d[i];
  }
}
int main() {
  int i, j;
  for (i = 0; i < 6; ++i) {
    cin >> x[i];
    f[i][7] = x[i];
  }
  rmax = min(f[2][7], min(f[4][7], f[5][7]));
  while (rmax >= 0) {
    for (i = 0; i < 6; ++i) {
      for (j = 1; j < 8; ++j) r[i][j] = f[i][j];
      r[i][7] -= rmax * f[i][0];
    }
    gauss();
    --rmax;
  }
  if (smin == inf) {
    cout << -1;
    return 0;
  }
  for (j = 0; j < 6; ++j) {
    for (i = 0; i < 7; ++i) x1[j] += f[j][i] * rez[i];
  }
  for (i = 0; i < 6; ++i)
    if (x1[i] != x[i]) {
      cout << "-1";
      return 0;
    }
  cout << smin << "\n";
  for (i = 0; i < 4; ++i) {
    for (j = 0; j < 7; ++j) {
      int t = rez[j];
      while (t--) cout << col[j][i];
    }
    cout << "\n";
  }
  return 0;
}
