#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
const int r = 4;
int x[3][10];
int h[r][r];
bool check() {
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < r; ++j) {
      if (i == j) continue;
      for (int k = 0; k < r; ++k) {
        if (i == k || j == k) continue;
        if (h[i][k] + h[k][j] < h[i][j]) return false;
        if ((h[i][k] + h[k][j] + h[i][j]) % 2) return false;
      }
    }
  }
  return true;
}
bool can(int n) {
  x[0][0] = n - h[0][1];
  x[0][1] = h[0][1];
  x[1][0] = (2 * x[0][0] + x[0][1] - h[0][2] - h[1][2]) / 2;
  x[1][1] = x[0][0] - x[1][0];
  x[1][2] = (x[0][1] - h[0][2] + h[1][2]) / 2;
  x[1][3] = x[0][1] - x[1][2];
  x[2][0] = 0;
  x[2][1] = x[1][0];
  x[2][2] = (n + x[1][0] + x[1][1] - h[0][3] - h[1][3]) / 2;
  x[2][3] = x[1][1] - x[2][2];
  x[2][6] = (h[1][3] + h[2][3] - x[1][1] - x[1][2] - 2 * x[1][0]) / 2;
  x[2][7] = x[1][3] - x[2][6];
  x[2][4] = (n + x[1][0] + x[1][2] - h[0][3] - h[2][3]) / 2;
  x[2][5] = x[1][2] - x[2][4];
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < (1 << i + 1); ++j) {
      if (x[i][j] < 0) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  int low = 0, ans = -1;
  for (int i = 0; i < r; ++i) {
    for (int j = i + 1; j < r; ++j) {
      scanf("%d", &h[i][j]);
      h[j][i] = h[i][j];
      low = max(low, h[i][j]);
    }
  }
  bool ok = check();
  if (!ok) {
    printf("-1\n");
  } else {
    for (ans = low; ans < 1000000; ++ans) {
      if (can(ans)) break;
    }
    printf("%d\n", ans);
    can(ans);
    for (int i = 0; i < ans; ++i) putchar('a');
    puts("");
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < (1 << i + 1); ++j) {
        for (int k = 0; k < x[i][j]; ++k) {
          if (j & 1)
            putchar('b');
          else
            putchar('a');
        }
      }
      puts("");
    }
  }
  return 0;
}
