#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
const double PI = 2 * acos(0.0);
const double EPS = 1e-8;
const int INF = (1 << 30) - 1;
int n, len;
int s[4][4], ss[4][4];
char ans[4][1000000];
void badquit() {
  cout << -1;
  exit(0);
}
void quit() {
  for (int i = 0; i < len; ++i) {
    for (int s1 = 0; s1 < 3; ++s1)
      for (int j = s1 + 1; j < 4; ++j)
        if (ans[s1][i] != ans[j][i]) ++ss[s1][j];
  }
  for (int i = 0; i < 4; ++i)
    for (int j = 0; j < 4; ++j)
      if (ss[i][j] != s[i][j]) {
        cout << -1;
        exit(0);
      }
  printf("%d\n", len);
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < len; ++j) printf("%c", ans[i][j]);
    printf("\n");
  }
  exit(0);
}
int main() {
  for (int i = 0; i < 3; ++i)
    for (int j = i + 1; j < 4; ++j) cin >> s[i][j];
  memset(ans, 'a', sizeof(ans));
  for (int i = 0; i < s[0][1]; ++i) ans[1][i] = 'b';
  int p = (s[1][2] + s[0][1] - s[0][2]);
  if (p < 0 || p % 2 == 1) badquit();
  p /= 2;
  if (p > s[0][1]) badquit();
  for (int i = p; i < s[0][2] + p; ++i) ans[2][i] = 'b';
  int cb2 = (s[0][1] + s[0][3] - s[1][3]);
  if (cb2 < 0 || cb2 % 2 == 1) badquit();
  cb2 /= 2;
  int cb3 = (s[0][2] + s[0][3] - s[2][3]);
  if (cb3 < 0 || cb3 % 2 == 1) badquit();
  cb3 /= 2;
  int mid = s[0][1] - p;
  int bestx = -1;
  int bestq = -1;
  for (int x = 0; x <= cb2 && x <= cb3 && x <= mid; ++x)
    if (cb2 - x <= p && cb3 - x <= p + s[0][2] - s[0][1]) {
      int currq = x + cb2 - x + cb3 - x;
      if (currq > bestq && currq <= s[0][3]) {
        bestx = x;
        bestq = currq;
      }
    }
  if (bestx == -1) badquit();
  for (int i = p; i < p + bestx; ++i) ans[3][i] = 'b';
  for (int i = 0; i < cb2 - bestx; ++i) ans[3][i] = 'b';
  for (int i = s[0][1]; i < s[0][1] + cb3 - bestx; ++i) ans[3][i] = 'b';
  len = p + s[0][2] + s[0][3] - bestq;
  for (int i = p + s[0][2]; i < len; ++i) ans[3][i] = 'b';
  quit();
  quit();
  return 0;
};
