#include <bits/stdc++.h>
using namespace std;
bool debug = true;
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> ptt) {
  os << ptt.first << "," << ptt.second;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vt) {
  os << "{";
  for (int i = 0; i < vt.size(); i++) {
    os << vt[i] << " ";
  }
  os << "}";
  return os;
}
int h[4][4];
inline int div2(int x) {
  if (x % 2 == 1) {
    cout << "-1";
    exit(0);
  } else {
    return x / 2;
  }
}
void draw(int x, char c) {
  for (int i = 0; i < x; i++) {
    cout << c;
  }
}
int a, b, c, d, e, f;
int main(int argc, char* argv[]) {
  for (int i = 0; i < 4; i++) {
    for (int j = i + 1; j < 4; j++) {
      cin >> h[i][j];
    }
  }
  int alpha = div2(h[0][2] + h[0][1] - h[1][2]);
  int beta = div2(h[0][2] - h[0][1] + h[1][2]);
  a = h[0][3];
  b = h[0][1];
  c = h[1][3];
  d = alpha;
  e = beta;
  f = h[2][3];
  int a1, a2, a3, a4, ans = 1e9;
  for (int x1 = 0; x1 <= alpha; x1++) {
    int x2 = div2(a + b - c) - x1;
    int x3 = div2(a + d + e - f) - x1;
    int x4 = div2(-b + c - d - e + f) + x1;
    if (x2 < 0 || x3 < 0 || x4 < 0 || x2 > h[0][1] - alpha || x3 > beta) {
      continue;
    }
    int tmp = h[0][1] + beta + x4;
    if (tmp < ans) {
      ans = tmp;
      a1 = x1;
      a2 = x2;
      a3 = x3;
      a4 = x4;
    }
  }
  if (ans == 1e9) {
    cout << -1;
    return 0;
  }
  cout << ans << endl;
  draw(ans, 'a');
  cout << endl;
  draw(h[0][1], 'b');
  draw(ans - h[0][1], 'a');
  cout << endl;
  draw(alpha, 'b');
  draw(h[0][1] - alpha, 'a');
  draw(beta, 'b');
  draw(ans - beta - h[0][1], 'a');
  cout << endl;
  draw(a1, 'b');
  draw(alpha - a1, 'a');
  draw(a2, 'b');
  draw(h[0][1] - alpha - a2, 'a');
  draw(a3, 'b');
  draw(beta - a3, 'a');
  draw(a4, 'b');
  cout << endl;
  return 0;
}
