#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000,100000000")
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
long long t[7];
long long e[100005];
long long p[7], q[7];
long long gauss(vector<vector<long double> > a, vector<long double>& ans) {
  long long n = a.size();
  long long m = a[0].size() - 1;
  vector<long long> where(m, -1);
  ans.clear();
  ans.resize(m);
  for (long long col = 0, row = 0; col < m && row < n; col++) {
    long long sel = row;
    for (long long i = row; i < n; i++)
      if (abs(a[i][col]) > abs(a[sel][col])) sel = i;
    if (abs(a[sel][col]) < eps) continue;
    swap(a[sel], a[row]);
    where[col] = row;
    for (long long i = 0; i < n; i++) {
      if (i == row) continue;
      long double c = a[i][col] / a[row][col];
      for (long long j = col; j <= m; j++) a[i][j] -= a[row][j] * c;
    }
    row++;
  }
  for (long long i = 0; i < m; i++)
    if (where[i] != -1) ans[i] = a[where[i]][m] / a[where[i]][i];
  for (long long i = 0; i < n; i++) {
    long double sum = 0.0;
    for (long long j = 0; j < m; j++) sum += a[i][j] * ans[j];
    if (abs(sum - a[i][m]) > eps) return 0;
  }
  for (long long i = 0; i < m; i++)
    if (where[i] == -1) return inf;
  return 1;
}
string s[] = {"aaba", "aabb", "abaa", "abab", "abba", "abbb", "aaab"};
long long print(long long x) {
  long long i = 0;
  i = 0;
  while (i < q[0]) cout << s[0][x], i++;
  i = 0;
  while (i < q[1]) cout << s[1][x], i++;
  i = 0;
  while (i < q[2]) cout << s[2][x], i++;
  i = 0;
  while (i < q[3]) cout << s[3][x], i++;
  i = 0;
  while (i < q[4]) cout << s[4][x], i++;
  i = 0;
  while (i < q[5]) cout << s[5][x], i++;
  i = 0;
  while (i < q[6]) cout << s[6][x], i++;
  cout << endl;
}
int main(void) {
  vector<vector<long double> > a;
  vector<long double> ans;
  vector<long double> rez;
  a.resize(6);
  for (long long i = 0; i < 6; i++) a[i].resize(7);
  a[0][0] = 0;
  a[0][1] = 0;
  a[0][2] = 1;
  a[0][3] = 1;
  a[0][4] = 1;
  a[0][5] = 1;
  a[1][0] = 1;
  a[1][1] = 1;
  a[1][2] = 0;
  a[1][3] = 0;
  a[1][4] = 1;
  a[1][5] = 1;
  a[2][0] = 0;
  a[2][1] = 1;
  a[2][2] = 0;
  a[2][3] = 1;
  a[2][4] = 0;
  a[2][5] = 1;
  a[3][0] = 1;
  a[3][1] = 1;
  a[3][2] = 1;
  a[3][3] = 1;
  a[3][4] = 0;
  a[3][5] = 0;
  a[4][0] = 0;
  a[4][1] = 1;
  a[4][2] = 1;
  a[4][3] = 0;
  a[4][4] = 1;
  a[4][5] = 0;
  a[5][0] = 1;
  a[5][1] = 0;
  a[5][2] = 0;
  a[5][3] = 1;
  a[5][4] = 1;
  a[5][5] = 0;
  p[0] = 0;
  p[1] = 0;
  p[2] = 1;
  p[3] = 0;
  p[4] = 1;
  p[5] = 1;
  for (long long i = 0; i < 6; i++) cin >> t[i], a[i][6] = t[i];
  long long now = inf;
  for (long long i = 0; i <= 100000; i++) {
    for (long long j = 0; j < 6; j++) a[j][6] -= i * p[j];
    if (gauss(a, rez) == 1) {
      long double sum = 0.0;
      for (long long j = 0; j < 6; j++) {
        sum += rez[j];
        long long w = rez[j] + eps;
        if (abs(w * 1.0 - rez[j]) > eps) goto end;
      }
      sum += i;
      if (sum < now) {
        now = sum;
        for (long long j = 0; j < 6; j++) q[j] = rez[j] + eps;
        q[6] = i;
      }
    }
  end:
    for (long long j = 0; j < 6; j++) a[j][6] += i * p[j];
  }
  if (now == inf) cout << -1 << endl, exit(0);
  cout << now << endl;
  print(0);
  print(1);
  print(2);
  print(3);
  return 0;
}
