#include <bits/stdc++.h>
using namespace std;
char s1[10000010], s2[10000010], s3[10000010], s4[10000010];
int abfg, aceg, adef, bcef, bdeg, cdfg;
int bfg, a, b, c, d, e, f, g, ans, aa, ab, ac, ad, ae, af, ag;
int main() {
  scanf("%d %d %d %d %d %d", &abfg, &aceg, &adef, &bcef, &bdeg, &cdfg);
  ans = 10000010;
  aa = ab = ac = ad = ae = af = ag = 0;
  for (a = 0; a <= 1000000; a++) {
    bfg = abfg - a;
    if (bfg < 0) continue;
    g = aceg + bfg - bcef - a;
    if (g < 0 || g & 1 == 1) continue;
    g = g >> 1;
    f = adef + bfg - bdeg - a;
    if (f < 0 || f & 1 == 1) continue;
    f = f >> 1;
    b = bfg - f - g;
    if (b < 0) continue;
    e = bcef + bdeg - cdfg - 2 * b;
    if (e < 0 || e & 1 == 1) continue;
    e = e >> 1;
    c = bcef - b - e - f;
    if (c < 0) continue;
    d = bdeg - b - e - g;
    if (d < 0) continue;
    if (abfg != a + b + f + g || aceg != a + c + e + g || adef != a + d + e + f)
      continue;
    if (bcef != b + c + e + f || bdeg != b + d + e + g || cdfg != c + d + f + g)
      continue;
    if (a + b + c + d + e + f + g < ans) {
      ans = a + b + c + d + e + f + g;
      aa = a;
      ab = b;
      ac = c;
      ad = d;
      ae = e;
      af = f;
      ag = g;
    }
  }
  if (ans == 10000010)
    cout << -1 << endl;
  else {
    printf("%d\n", ans);
    for (int i = 0; i < aa; i++) {
      s1[i] = 'a';
      s2[i] = 'b';
      s3[i] = 'b';
      s4[i] = 'b';
    }
    for (int i = aa; i < aa + ab; i++) {
      s1[i] = 'b';
      s2[i] = 'a';
      s3[i] = 'b';
      s4[i] = 'b';
    }
    for (int i = aa + ab; i < aa + ab + ac; i++) {
      s1[i] = 'b';
      s2[i] = 'b';
      s3[i] = 'a';
      s4[i] = 'b';
    }
    for (int i = aa + ab + ac; i < aa + ab + ac + ad; i++) {
      s1[i] = 'b';
      s2[i] = 'b';
      s3[i] = 'b';
      s4[i] = 'a';
    }
    for (int i = aa + ab + ac + ad; i < aa + ab + ac + ad + ae; i++) {
      s1[i] = 'a';
      s2[i] = 'a';
      s3[i] = 'b';
      s4[i] = 'b';
    }
    for (int i = aa + ab + ac + ad + ae; i < aa + ab + ac + ad + ae + af; i++) {
      s1[i] = 'a';
      s2[i] = 'b';
      s3[i] = 'a';
      s4[i] = 'b';
    }
    for (int i = aa + ab + ac + ad + ae + af;
         i < aa + ab + ac + ad + ae + af + ag; i++) {
      s1[i] = 'b';
      s2[i] = 'a';
      s3[i] = 'a';
      s4[i] = 'b';
    }
    for (int i = 0; i < ans; i++) cout << s1[i];
    cout << endl;
    for (int i = 0; i < ans; i++) cout << s2[i];
    cout << endl;
    for (int i = 0; i < ans; i++) cout << s3[i];
    cout << endl;
    for (int i = 0; i < ans; i++) cout << s4[i];
    cout << endl;
  }
  return 0;
}
