#include <bits/stdc++.h>
using namespace std;
int a[6][6] = {{-1, -1, 0, 0, 1, 1}, {-1, 0, 1, -1, 0, 1}, {0, 1, 0, 1, 0, -1},
               {0, -1, 1, -1, 1, 0}, {1, 0, 0, 1, -1, 0},  {1, 1, -1, 0, 0, 0}};
int l[6] = {1, 1, 0, 1, 0, 0};
int ml;
int mx[7], dg[7], in[6];
int x[7], y[6];
inline void print(int x) {
  int i;
  for (i = 0; i < 7; i++) {
    dg[6 - i] = x % 10;
    x /= 10;
  }
  for (i = 0; i < 7; i++) {
    int a = mx[i];
    while (a--) putchar(dg[i] ? 'b' : 'a');
  }
  puts("");
}
inline void solve(int lx) {
  int i, j;
  for (i = 0; i < 6; i++) {
    x[i] = in[i] - lx * l[i];
    if (x[i] < 0) return;
  }
  int s = 0;
  for (i = 0; i < 6; i++) {
    y[i] = 0;
    for (j = 0; j < 6; j++) y[i] += x[j] * a[i][j];
    if (y[i] % 2 != 0 || y[i] < 0) return;
    y[i] /= 2;
    s += y[i];
  }
  if (s < ml) {
    ml = s;
    for (i = 0; i < 6; i++) mx[i] = y[i];
    mx[6] = lx;
  }
  return;
}
int main() {
  int i, ma = 0;
  for (i = 0; i < 6; i++) {
    cin >> in[i];
    ma = max(ma, in[i]);
  }
  swap(in[2], in[3]);
  ml = 1000000000;
  for (i = 0; i <= ma; i++) solve(i);
  if (ml == 1000000000)
    puts("-1");
  else {
    int r = 0;
    for (i = 0; i < 7; i++) r += mx[i];
    cout << r << '\n';
    print(0);
    print(1111);
    print(110011);
    print(1010101);
  }
  return 0;
}
