#include <bits/stdc++.h>
using namespace std;
int ans[16];
int main() {
  int a, b, c, d, e, f;
  int s[6] = {0}, i, j, k;
  scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f);
  s[0] = a + b - e - f;
  s[1] = a - c + d - f;
  s[2] = c + e - a;
  s[3] = b - c + d - e;
  s[4] = c - b + f;
  s[5] = e + f - d;
  for (i = 0; i < 6; ++i)
    if (s[i] & 1) {
      printf("-1\n");
      return 0;
    } else
      s[i] >>= 1;
  ans[7] = max(0, max(-s[0], max(-s[1], -s[3])));
  ans[1] = s[0] + ans[7];
  ans[2] = s[1] + ans[7];
  ans[3] = s[2] - ans[7];
  ans[4] = s[3] + ans[7];
  ans[5] = s[4] - ans[7];
  ans[6] = s[5] - ans[7];
  int len = 0;
  for (i = 1; i <= 7; ++i)
    if (ans[i] < 0) {
      printf("-1\n");
      return 0;
    } else
      len += ans[i];
  printf("%d\n", len);
  for (i = 0; i < 4; ++i) {
    for (j = 1; j <= 7; ++j) {
      char ch = !!(j & (1 << i)) + 'a';
      for (k = 0; k < ans[j]; ++k) printf("%c", ch);
    }
    printf("\n");
  }
  return 0;
}
