#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
int s[10], loc[10], row, col;
double A[10][10];
void gauss() {
  int x, y;
  for (x = 0, y = 0; x < row && y < col; y++) {
    int p = x;
    for (int i = (x + 1); i < (row); ++i)
      if (fabs(A[i][y]) > fabs(A[p][y]) + 1e-9) p = i;
    if (fabs(A[p][y]) < 1e-9) continue;
    if (p != x)
      for (int j = (y); j < (col + 1); ++j) swap(A[p][j], A[x][j]);
    loc[y] = x;
    for (int i = (0); i < (row); ++i) {
      if (i == x || fabs(A[i][y]) < 1e-9) continue;
      double tmp = A[i][y] / A[x][y];
      for (int j = (y); j < (col + 1); ++j) A[i][j] -= A[x][j] * tmp;
    }
    x++;
  }
  for (int j = (0); j < (col); ++j) {
    if (loc[j] == -1) continue;
    A[loc[j]][col] /= A[loc[j]][j];
    A[loc[j]][j] /= A[loc[j]][j];
  }
  return;
}
int init[6][7], tmp[7], res[8], fin[8];
int check(int x0) {
  int val[7] = {0};
  for (int i = (1); i < (7); ++i) {
    for (int j = (0); j < (6); ++j) {
      val[j] += init[j][i] * res[i - 1];
    }
  }
  for (int j = (0); j < (6); ++j) {
    val[j] += init[j][0] * x0;
  }
  for (int i = (0); i < (6); ++i)
    if (val[i] != tmp[i]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b = 0, c, d = 0, e, f = 0, g = 0, h = 0, x, y, z = 0;
  for (int i = (1); i < (8); ++i) {
    b = 0;
    for (int j = (0); j < (4); ++j) {
      for (int k = j + 1; k < 4; k++) {
        b++;
        if ((i & 1 << j) && (i & 1 << k))
          continue;
        else if ((i & 1 << j) == 0 && (i & 1 << k) == 0)
          continue;
        else
          init[b - 1][d] = 1;
      }
    }
    d++;
  }
  for (int i = (0); i < (6); ++i) cin >> tmp[i];
  for (int i = (0); i < (6); ++i) g = max(g, tmp[i] * 1ll);
  h = g * 1000;
  for (int i = 0; i <= g; i++) {
    row = 6;
    col = 6;
    memset(A, 0, sizeof A);
    for (int j = 0; j < 6; j++) {
      for (int k = 1; k <= 6; k++) A[j][k - 1] = init[j][k];
    }
    f = 0;
    for (int j = 0; j < 6; j++) {
      if (tmp[j] < init[j][0] * i) {
        f = 1;
        break;
      }
      A[j][6] = tmp[j] - init[j][0] * i;
    }
    if (f) continue;
    gauss();
    for (int j = 0; j < 6; j++) {
      double p = A[j][col];
      if (p < -1e-9) {
        f = 1;
        break;
      }
      double q = p + 1e-7 - floor(p + 1e7);
      if (q > 1e-3) {
        f = 1;
        break;
      }
      res[j] = (int)(p + 1e-7);
    }
    if (f) continue;
    f = i;
    for (int j = (0); j < (6); ++j) f += res[j];
    if (f < h && check(i)) {
      h = f;
      for (int j = (1); j < (7); ++j) fin[j] = res[j - 1];
      fin[0] = i;
    }
  }
  if (h > 100 * g)
    cout << -1 << endl;
  else {
    cout << h << endl;
    string ret[4];
    for (int i = (0); i < (7); ++i) {
      for (int j = (0); j < (fin[i]); ++j) {
        for (int k = (0); k < (4); ++k) {
          if ((i + 1) & 1 << k)
            ret[k] += "a";
          else
            ret[k] += "b";
        }
      }
    }
    for (int i = (0); i < (4); ++i) cout << ret[i] << endl;
  }
}
