#include <bits/stdc++.h>
using namespace std;
int x1, x2, x3, x4, x5, x6, mna, mn;
double b, c, d, e, f, g;
char s[4][600001];
int main() {
  scanf("%d%d%d%d%d%d", &x1, &x2, &x3, &x4, &x5, &x6);
  mn = 0x3f3f3f3f;
  for (int a = 0; a <= 500000; ++a) {
    b = (x4 - x3 - x5 + x2) / 2.0 + a, c = (x1 - x3 - x6 + x4) / 2.0 + a,
    d = (x3 + x5 - x1) / 2.0 - a, e = (x3 + x6 - x2) / 2.0 - a,
    f = (x5 + x6 - x4) / 2.0 - a, g = a - (x5 - x1 + x6 - x2) / 2.0;
    if (b < 0 || c < 0 || d < 0 || e < 0 || f < 0 || g < 0 || (int)b != b ||
        (int)c != c || (int)d != d || (int)e != e || (int)f != f || (int)g != g)
      continue;
    if (a + b + c + d + e + f + g >= mn) continue;
    mn = a + b + c + d + e + f + g;
    mna = a;
  }
  int a = mna, pt = 1;
  if (mn == 0x3f3f3f3f) {
    printf("-1\n");
    return 0;
  }
  b = (x4 - x3 - x5 + x2) / 2.0 + a, c = (x1 - x3 - x6 + x4) / 2.0 + a,
  d = (x3 + x5 - x1) / 2.0 - a, e = (x3 + x6 - x2) / 2.0 - a,
  f = (x5 + x6 - x4) / 2.0 - a, g = a - (x5 - x1 + x6 - x2) / 2.0;
  char X = 'a', x = 'b';
  for (int i = 1; i <= a; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = X, s[2][pt] = X, s[3][pt] = x;
  ;
  for (int i = 1; i <= b; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = X, s[2][pt] = x, s[3][pt] = X;
  ;
  for (int i = 1; i <= c; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = x, s[2][pt] = X, s[3][pt] = X;
  ;
  for (int i = 1; i <= d; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = X, s[2][pt] = x, s[3][pt] = x;
  ;
  for (int i = 1; i <= e; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = x, s[2][pt] = X, s[3][pt] = x;
  ;
  for (int i = 1; i <= f; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = x, s[2][pt] = x, s[3][pt] = X;
  ;
  for (int i = 1; i <= g; ++i, ++pt)
    s[0][pt] = X, s[1][pt] = x, s[2][pt] = x, s[3][pt] = x;
  ;
  printf("%.0lf\n%s\n%s\n%s\n%s\n", a + b + c + d + e + f + g, s[0] + 1,
         s[1] + 1, s[2] + 1, s[3] + 1);
  return 0;
}
