#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128777216")
using namespace std;
int d[4][4];
char s[1100000];
void minus1() {
  printf("-1");
  exit(0);
}
int getb12(int i, int j) {
  int k = d[0][i] + d[0][j] - d[i][j];
  if (k & 1) {
    minus1();
  }
  return k >>= 1;
}
int main() {
  for (int i = 0; i < 4; i++) {
    for (int j = i + 1; j < 4; j++) {
      int t;
      scanf("%d", &t);
      d[i][j] = d[j][i] = t;
    }
  }
  int len = 0;
  int b12 = getb12(1, 2);
  int ba12 = d[0][1] - b12;
  int ab12 = d[0][2] - b12;
  len = ba12 + ab12 + b12;
  int s0 = d[0][3], s1 = getb12(1, 3), s2 = getb12(2, 3);
  int db1 = 0;
  db1 = max(db1, s1 - ba12);
  db1 = max(db1, s2 - ab12);
  db1 = max(db1, -(s0 - s1 - s2));
  int b4 = s0 - s1 - s2 + db1;
  int b1 = db1;
  int b2 = s1 - b1;
  int b3 = s2 - b1;
  if (b1 > b12 || b2 < 0 || b3 < 0) {
    minus1();
  }
  len += b4;
  printf("%d\n", len);
  s[len] = 0;
  for (int i = 0; i < len; i++) {
    s[i] = 'a';
  }
  printf("%s\n", s);
  for (int i = 0; i < len; i++) {
    s[i] = (i < b12 + ba12 ? 'b' : 'a');
  }
  printf("%s\n", s);
  for (int i = 0; i < len; i++) {
    if (i < b12 || i >= b12 + ba12 && i < b12 + ba12 + ab12) {
      s[i] = 'b';
    } else {
      s[i] = 'a';
    }
  }
  printf("%s\n", s);
  for (int i = 0; i < len; i++) {
    if (i < b1 || i >= b12 && i < b12 + b2 ||
        i >= b12 + ba12 && i < b12 + ba12 + b3 || i >= len - b4) {
      s[i] = 'b';
    } else {
      s[i] = 'a';
    }
  }
  printf("%s\n", s);
  return 0;
}
