#include <bits/stdc++.h>
using namespace std;
int d12, d13, d14, d23, d24, d34;
char s1[500000], s2[500000], s3[500000], s4[500000];
bool out = false;
bool can(int len) {
  int a = d12, b = len - a;
  if (a < 0 || b < 0) return false;
  if ((d13 + d23 - a) & 1) return false;
  int e = (d13 + d23 - a) / 2, c = d13 - e, d = a - c, f = b - e;
  if (e < 0 || c < 0 || d < 0 || f < 0) return false;
  if (((d34 + d24 - d - e) & 1) || ((d24 + d14 - c - d) & 1) ||
      ((d14 + d34 - c - e) & 1))
    return false;
  int up = (d34 + d24 - d - e) / 2;
  for (int tmp = 0; tmp <= up; ++tmp) {
    int v = tmp, h = (d34 + d24 - d - e) / 2 - v,
        r = (d24 + d14 - c - d) / 2 - v, p = (d14 + d34 - c - e) / 2 - v;
    int g = c - h, q = d - p, t = e - r, l = f - v;
    if (v < 0 || h < 0 || r < 0 || p < 0 || g < 0 || q < 0 || t < 0 || l < 0)
      continue;
    if (out) {
      for (int i = 0; i < len; ++i) s1[i] = 'a';
      int lpos = 0;
      for (int i = 0; i < a; ++i) s2[lpos++] = 'b';
      for (int i = 0; i < b; ++i) s2[lpos++] = 'a';
      lpos = 0;
      for (int i = 0; i < c; ++i) s3[lpos++] = 'b';
      for (int i = 0; i < d; ++i) s3[lpos++] = 'a';
      for (int i = 0; i < e; ++i) s3[lpos++] = 'b';
      for (int i = 0; i < f; ++i) s3[lpos++] = 'a';
      lpos = 0;
      for (int i = 0; i < g; ++i) s4[lpos++] = 'b';
      for (int i = 0; i < h; ++i) s4[lpos++] = 'a';
      for (int i = 0; i < p; ++i) s4[lpos++] = 'b';
      for (int i = 0; i < q; ++i) s4[lpos++] = 'a';
      for (int i = 0; i < r; ++i) s4[lpos++] = 'b';
      for (int i = 0; i < t; ++i) s4[lpos++] = 'a';
      for (int i = 0; i < v; ++i) s4[lpos++] = 'b';
      for (int i = 0; i < l; ++i) s4[lpos++] = 'a';
    }
    return true;
  }
  return false;
}
int main() {
  scanf("%d%d%d%d%d%d", &d12, &d13, &d14, &d23, &d24, &d34);
  int lo = 1, hi = 500000 - 10, mid;
  for (;;) {
    if (lo + 1 >= hi) {
      if (can(lo))
        mid = lo;
      else
        mid = hi;
      break;
    }
    mid = (lo + hi) / 2;
    if (can(mid))
      hi = mid;
    else
      lo = mid;
  }
  out = true;
  if (!can(mid))
    printf("-1\n");
  else {
    printf("%d\n", mid);
    printf("%s\n%s\n%s\n%s\n", s1, s2, s3, s4);
  }
  return 0;
}
