#include <bits/stdc++.h>
using namespace std;
const int N = 1;
const double eps = 1e-9;
const int oo = 1000000000;
int s[5][5];
bool solve() {
  if (s[2][3] < abs(s[1][2] - s[1][3])) {
    return false;
  }
  if (s[2][4] < abs(s[1][2] - s[1][4])) {
    return false;
  }
  if (s[3][4] < abs(s[1][3] - s[1][4])) {
    return false;
  }
  if (s[1][2] + s[1][3] < s[2][3] || (s[1][2] + s[1][3] - s[2][3]) % 2) {
    return false;
  }
  if (s[1][2] + s[1][4] < s[2][4] || (s[1][2] + s[1][4] - s[2][4]) % 2) {
    return false;
  }
  if (s[1][3] + s[1][4] < s[3][4] || (s[1][3] + s[1][4] - s[3][4]) % 2) {
    return false;
  }
  int d[5][5];
  d[2][3] = (s[1][2] + s[1][3] - s[2][3]) / 2;
  d[2][4] = (s[1][2] + s[1][4] - s[2][4]) / 2;
  d[3][4] = (s[1][3] + s[1][4] - s[3][4]) / 2;
  int ans = oo, j;
  for (int i = 0; i <= d[2][3] && i <= d[2][4] && i <= d[3][4]; ++i) {
    if (s[1][2] - d[2][3] < d[2][4] - i) {
      continue;
    }
    if (s[1][3] - d[2][3] < d[3][4] - i) {
      continue;
    }
    if (s[1][4] - i - (d[2][4] - i) - (d[3][4] - i) < 0) {
      continue;
    }
    int temp =
        s[1][4] - i - (d[2][4] - i) - (d[3][4] - i) + (d[2][3] + s[2][3]);
    if (temp < ans) {
      ans = temp;
      j = i;
    }
  }
  if (ans < oo) {
    cout << ans << endl;
    cout << string(ans, 'a') << endl;
    cout << string(s[1][2], 'b') << string(ans - s[1][2], 'a') << endl;
    cout << string(d[2][3], 'b') << string(s[1][2] - d[2][3], 'a')
         << string(s[1][3] - d[2][3], 'b')
         << string(ans - s[2][3] - d[2][3], 'a') << endl;
    string last = string(j, 'b');
    while (last.size() < d[2][3]) {
      last.append("a");
    }
    last = last.append(string(d[2][4] - j, 'b'));
    while (last.size() < s[1][2]) {
      last.append("a");
    }
    last = last.append(string(d[3][4] - j, 'b'));
    while (last.size() < s[2][3] + d[2][3]) {
      last.append("a");
    }
    while (last.size() < ans) {
      last.append("b");
    }
    cout << last << endl;
    return true;
  }
  return false;
}
int main() {
  cin >> s[1][2] >> s[1][3] >> s[1][4];
  cin >> s[2][3] >> s[2][4];
  cin >> s[3][4];
  if (!solve()) {
    puts("-1");
  }
  return 0;
}
