#include <bits/stdc++.h>
using namespace std;
int w[4][4];
char s3[1000010], s4[1000010];
int main() {
  int i, j, k;
  for (i = 0; i < 3; i++)
    for (j = i + 1; j < 4; j++) scanf("%d", &w[i][j]), w[j][i] = w[i][j];
  int len, l1, l2, l3, l4, l5;
  len = w[0][1];
  int A, B, a, b;
  A = w[2][0], B = w[2][1];
  if ((len + A - B) % 2) {
    puts("-1");
    return 0;
  }
  a = (len + A - B) / 2, b = len - a;
  if (a < 0 || b < 0 || a > A || b > B) {
    puts("-1");
    return 0;
  }
  l2 = A - a;
  l1 = a;
  A = w[3][0], B = w[3][1];
  if ((len + A - B) % 2) {
    puts("-1");
    return 0;
  }
  a = (len + A - B) / 2, b = len - a;
  if (a < 0 || b < 0 || a > A || b > B) {
    puts("-1");
    return 0;
  }
  l4 = A - a;
  l3 = a;
  if (w[2][3] < (abs(l1 - l3) + abs(l2 - l4)) ||
      w[2][3] > abs(l1 - l3) + abs(l2 - l4) +
                    (min(min(l1, l3), len - max(l1, l3)) + l2 + l4) * 2 ||
      (w[2][3] % 2) != ((abs(l1 - l3) + abs(l2 - l4)) % 2)) {
    puts("-1");
    return 0;
  }
  for (i = 0; i < 1000000; i++) s3[i] = s4[i] = 'a';
  for (i = len - l1 + 1; i <= len; i++) s3[i] = 'b';
  for (i = len + 1; i <= len + l2; i++) s3[i] = 'b';
  for (i = len - l3 + 1; i <= len; i++) s4[i] = 'b';
  for (i = len + 1; i <= len + l4; i++) s4[i] = 'b';
  int ll = min(l1, l3), rr = min(l2, l4), tou = 1;
  w[2][3] -= abs(l1 - l3) + abs(l2 - l4);
  for (i = 1; i <= len - max(l1, l3) && w[2][3] && i <= ll; i++)
    swap(s3[i], s3[len - i + 1]), w[2][3] -= 2;
  rr = max(l2, l4);
  for (i = 1; w[2][3]; i++) {
    ++rr;
    swap(s3[len + i], s3[len + rr]);
    w[2][3] -= 2;
  }
  printf("%d\n", len + rr);
  for (i = 1; i <= len + rr; i++) printf("a");
  puts("");
  for (i = 1; i <= len; i++) printf("b");
  for (; i <= len + rr; i++) printf("a");
  puts("");
  for (i = 1; i <= len + rr; i++) printf("%c", s3[i]);
  puts("");
  for (i = 1; i <= len + rr; i++) printf("%c", s4[i]);
  puts("");
}
