#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.14159265359;
template <typename T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
void chmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
void chmax(T &x, T y) {
  x = max(x, y);
}
template <typename U, typename V>
ostream &operator<<(ostream &s, const pair<U, V> &x) {
  s << "(" << x.first << ", " << x.second << ")";
  return s;
}
template <typename U>
ostream &operator<<(ostream &s, const vector<U> &x) {
  s << "[";
  bool was = false;
  for (auto it : x) {
    if (was) {
      s << ", ";
    }
    was = true;
    s << it;
  }
  s << "]";
  return s;
}
const long double eps = 1e-9;
void g(vector<vector<long double>> a, vector<long double> b,
       vector<long long> &res) {
  int n = a.size();
  for (int i = 0; i < n; i++) {
    int j = i;
    while (j < n && abs(a[j][i]) < eps) {
      j++;
    }
    if (j == n) {
      return;
    }
    swap(a[i], a[j]);
    swap(b[i], b[j]);
    for (int h = 0; h < n; h++) {
      if (h == i) {
        continue;
      }
      long double c = a[h][i] / a[i][i];
      for (int j = 0; j < n; j++) {
        a[h][j] -= a[i][j] * c;
      }
      b[h] -= c * b[i];
    }
  }
  for (int i = 0; i < n; i++) {
    res[i] = round(b[i] / a[i][i]);
  }
}
int main() {
  srand(time(NULL));
retry:
  map<vector<int>, vector<int>> s;
  for (int i = 0; i < (1 << 4); i++) {
    int x = i;
    vector<int> a;
    for (int j = 0; j < 4; j++) {
      a.push_back(x & 1);
      x /= 2;
    }
    vector<int> h;
    int cnt = 0;
    for (int j = 0; j < 4; j++) {
      for (int k = j + 1; k < 4; k++) {
        h.push_back(abs(a[j] - a[k]));
        cnt += abs(a[j] - a[k]);
      }
    }
    if (cnt) {
      s[h] = a;
    }
  }
  vector<pair<vector<int>, vector<int>>> b;
  for (auto kv : s) {
    b.push_back(make_pair(kv.first, kv.second));
  }
  vector<long long> a;
  for (int i = 0; i < 6; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  const int inf = 1e9;
  pair<long long, vector<long long>> bst(inf, vector<long long>());
  vector<vector<long double>> m(6, vector<long double>(6, 0));
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      m[i][j] = b[j + 1].first[i];
    }
  }
  for (int i = 0; i < 200005; i++) {
    bool good = true;
    vector<long double> d(6);
    for (int j = 0; j < 6; j++) {
      good &= (a[j] >= b[0].first[j] * i);
      d[j] = a[j] - b[0].first[j] * i;
    }
    vector<long long> res(6, 0);
    g(m, d, res);
    for (int j = 0; j < 6; j++) {
      long long c = 0;
      for (int h = 0; h < 6; h++) {
        c += b[h + 1].first[j] * res[h];
      }
      good &= (c == (a[j] - b[0].first[j] * i));
      good &= res[j] >= 0;
    }
    if (good) {
      vector<long long> g;
      g.push_back(i);
      long long c = i;
      for (long long x : res) {
        g.push_back(x);
        c += x;
      }
      chmin(bst, make_pair(c, g));
    }
  }
  if (bst.first == inf) {
    cout << -1 << endl;
    return 0;
  }
  vector<vector<int>> ans(4);
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < bst.second[i]; j++) {
      for (int h = 0; h < 4; h++) {
        ans[h].push_back(b[i].second[h]);
      }
    }
  }
  cout << ans[0].size() << endl;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < ans[i].size(); j++) {
      printf("%c", ans[i][j] ? 'a' : 'b');
    }
    printf("\n");
  }
  return 0;
}
