#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 4;
const int K = 26;
const int M = 1005;
const int inf = (int)1e9 + 7;
int h[4][4];
int main() {
  for (int i = 0; i <= 3; ++i) {
    for (int j = i + 1; j <= 3; ++j) {
      cin >> h[i][j];
    }
  }
  string a[4];
  for (int i = 0; i < h[0][1]; ++i) {
    a[0] += 'a';
    a[1] += 'b';
  }
  if ((h[1][2] + h[0][2] - h[0][1]) % 2 == 1 || h[1][2] + h[0][2] < h[0][1]) {
    printf("-1");
    return 0;
  }
  int x = (h[1][2] + h[0][2] - h[0][1]) / 2;
  for (int i = 0; i < h[0][2] - x; ++i) {
    a[2] += 'b';
  }
  for (int i = 0; i < h[1][2] - x; ++i) {
    a[2] += 'a';
  }
  for (int i = 0; i < x; ++i) {
    a[0] += 'a';
    a[1] += 'a';
    a[2] += 'b';
  }
  if (h[0][1] + h[1][3] < h[0][3] || (h[0][1] + h[1][3] - h[0][3]) % 2 == 1) {
    printf("-1");
    return 0;
  }
  int y = (h[0][1] + h[1][3] - h[0][3]) / 2;
  int m = -1;
  int ans = inf;
  for (int i = 0; i <= x; ++i) {
    int p = h[0][3] - x - h[0][1] + i + y;
    if (p >= 0 && h[1][3] == p + x - i + y) {
      int d = h[2][3] - i - p;
      int s = (h[1][2] - x + y - d) / 2;
      if (p + h[0][1] + x < ans && s <= h[1][2] - x && s <= y &&
          y - s <= h[0][2] - x && s >= 0 && d >= 0 &&
          2 * s == h[1][2] - x + y - d) {
        ans = p + h[0][1] + x;
        m = i;
      }
    }
  }
  if (ans == inf) {
    printf("-1");
    return 0;
  }
  int p = h[0][3] - x - h[0][1] + m + y, d = h[2][3] - m - p,
      s = (h[1][2] - x + y - d) / 2;
  for (int j = 0; j < h[0][2] - x - y + s; ++j) {
    a[3] += 'b';
  }
  for (int j = 0; j < y - s; ++j) {
    a[3] += 'a';
  }
  for (int j = 0; j < h[1][2] - x - s; ++j) {
    a[3] += 'b';
  }
  for (int j = 0; j < s; ++j) {
    a[3] += 'a';
  }
  for (int j = 0; j < m; ++j) {
    a[3] += 'a';
  }
  for (int j = 0; j < x - m; ++j) {
    a[3] += 'b';
  }
  for (int j = 0; j < p; ++j) {
    a[0] += 'a';
    a[1] += 'a';
    a[2] += 'a';
    a[3] += 'b';
  }
  cout << ans << '\n';
  for (int i = 0; i < 4; ++i) {
    cout << a[i] << '\n';
  }
  return 0;
}
