#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const double EPS = 1e-9;
const double PI = acos(-1.);
const long long LL_INF = 1e17 + 16;
const int INF = 1e9 + 10;
const long long MOD = 998244353;
const int MAXN = 4e5 + 5;
char s[4][MAXN];
int g[4][4];
void solve() {
  for (int i = (0); i < (int)(4); i++) {
    for (int j = (i + 1); j < (int)(4); j++) {
      scanf("%d", &g[i][j]);
      g[j][i] = g[i][j];
    }
  }
  for (int i = (0); i < (int)(4); i++) {
    for (int j = (0); j < (int)(4); j++) {
      for (int k = (0); k < (int)(4); k++) {
        if (g[i][j] > g[i][k] + g[k][j]) {
          printf("-1\n");
          return;
        }
        if ((g[i][j] + g[i][k] + g[j][k]) & 1) {
          printf("-1\n");
          return;
        }
      }
    }
  }
  int y = (g[0][1] + g[0][2] - g[1][2]) / 2;
  int x = (g[0][1] + g[1][2] - g[0][2]) / 2;
  int z = g[1][2] - x;
  if (x < 0 || y < 0 || z < 0) {
    printf("-1\n");
    return;
  }
  for (int i = (0); i < (int)(x); i++) {
    s[0][i] = 'a';
    s[1][i] = 'b';
    s[2][i] = 'a';
  }
  for (int i = (0); i < (int)(y); i++) {
    s[0][x + i] = 'a';
    s[1][x + i] = 'b';
    s[2][x + i] = 'b';
  }
  for (int i = (0); i < (int)(z); i++) {
    s[0][x + y + i] = 'a';
    s[1][x + y + i] = 'a';
    s[2][x + y + i] = 'b';
  }
  int lim = 100005;
  for (int w = (0); w <= (int)(lim); w++) {
    int v = (g[0][3] + g[1][3] - g[0][1]) / 2 - w;
    int q = (g[0][3] + g[2][3] - g[0][2]) / 2 - w;
    int r = (g[1][3] + g[2][3] - g[1][2]) / 2 - w;
    int p = x - q;
    int t = y - r;
    int u = z - v;
    if (p < 0 || q < 0 || r < 0 || t < 0 || u < 0 || v < 0) {
      continue;
    }
    int offset = 0;
    for (int i = (0); i < (int)(p); i++) {
      s[3][offset + i] = 'a';
    }
    offset += p;
    for (int i = (0); i < (int)(q); i++) {
      s[3][offset + i] = 'b';
    }
    offset += q;
    for (int i = (0); i < (int)(r); i++) {
      s[3][offset + i] = 'a';
    }
    offset += r;
    for (int i = (0); i < (int)(t); i++) {
      s[3][offset + i] = 'b';
    }
    offset += t;
    for (int i = (0); i < (int)(u); i++) {
      s[3][offset + i] = 'a';
    }
    offset += u;
    for (int i = (0); i < (int)(v); i++) {
      s[3][offset + i] = 'b';
    }
    offset += v;
    for (int i = (0); i < (int)(w); i++) {
      s[0][offset + i] = 'a';
      s[1][offset + i] = 'a';
      s[2][offset + i] = 'a';
      s[3][offset + i] = 'b';
    }
    offset += w;
    printf("%d\n", offset);
    for (int i = (0); i < (int)(4); i++) {
      printf("%s\n", s[i]);
    }
    return;
  }
  printf("-1\n");
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
