#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
template <class T>
T SQR(const T &a) {
  return a * a;
}
string genMask(int a) {
  int A[4][4] = {0};
  for (int i = (0), ei = (4); i < ei; i++)
    for (int j = (0), ej = (4); j < ej; j++)
      if (((a >> i) ^ (a >> j)) & 1) A[i][j] = 1;
  string res;
  for (int i = (0), ei = (4); i < ei; i++)
    for (int j = (i + 1), ej = (4); j < ej; j++)
      res = res + char(A[i][j] + '0');
  return res;
}
const int INF = 1e9;
const double EPS = 1e-9;
int gauss(double a[6][7], double ans[6]) {
  int n = 6;
  int m = 6;
  int where[6];
  memset(where, -1, sizeof(where));
  for (int col = 0, row = 0; col < m && row < n; ++col) {
    int sel = row;
    for (int i = row; i < n; ++i)
      if (abs(a[i][col]) > abs(a[sel][col])) sel = i;
    if (abs(a[sel][col]) < EPS) continue;
    for (int i = col; i <= m; ++i) swap(a[sel][i], a[row][i]);
    where[col] = row;
    for (int i = 0; i < n; ++i)
      if (i != row) {
        double c = a[i][col] / a[row][col];
        for (int j = col; j <= m; ++j) a[i][j] -= a[row][j] * c;
      }
    ++row;
  }
  for (int i = (0), ei = (m); i < ei; i++) ans[i] = 0;
  for (int i = 0; i < m; ++i)
    if (where[i] != -1) ans[i] = a[where[i]][m] / a[where[i]][i];
  for (int i = 0; i < n; ++i) {
    double sum = 0;
    for (int j = 0; j < m; ++j) sum += ans[j] * a[i][j];
    if (abs(sum - a[i][m]) > EPS) return 0;
  }
  for (int i = 0; i < m; ++i)
    if (where[i] == -1) return -1;
  return 1;
}
void run() {
  const int Cnt = 7;
  int M[Cnt] = {1, 2, 4, 8, 9, 5, 3};
  int MA[7][6];
  for (int i = (0), ei = (Cnt); i < ei; i++) {
    string curr = genMask(M[i]);
    for (int j = (0), ej = (6); j < ej; j++) MA[i][j] = curr[j] - '0';
  }
  double A[6][7];
  int B[6];
  for (int i = (0), ei = (6); i < ei; i++) scanf("%d", B + i);
  int Best[7];
  int bestSum = INF;
  double Curr[7];
  int st = INF;
  for (int i = (0), ei = (6); i < ei; i++)
    if (MA[6][i]) st = min(st, B[i]);
  int Calc[7];
  for (int a = 0; a <= st; ++a) {
    memset(A, 0, sizeof(A));
    for (int i = (0), ei = (6); i < ei; i++)
      for (int j = (0), ej = (6); j < ej; j++) A[j][i] = MA[i][j];
    for (int i = (0), ei = (6); i < ei; i++) A[i][6] = B[i];
    int res = gauss(A, Curr);
    if (res == 1) {
      bool allOk = 1;
      Calc[6] = a;
      for (int i = (0), ei = (6); i < ei; i++)
        if (Curr[i] > -EPS) {
          Calc[i] = Curr[i] + EPS;
          if (fabs(Calc[i] - Curr[i]) > EPS) allOk = 0;
        } else
          allOk = 0;
      if (allOk) {
        int sum = 0;
        for (int i = (0), ei = (7); i < ei; i++) sum += Calc[i];
        if (sum < bestSum) {
          bestSum = sum;
          memcpy(Best, Calc, sizeof(Best));
        }
      }
    }
    for (int i = (0), ei = (6); i < ei; i++)
      if (MA[6][i]) B[i]--;
  }
  if (bestSum == INF)
    printf("-1\n");
  else {
    char Res[4][1000002] = {0};
    int cnt = 0;
    for (int i = (0), ei = (7); i < ei; i++)
      for (int j = (0), ej = (Best[i]); j < ej; j++) {
        for (int k = (0), ek = (4); k < ek; k++)
          Res[k][cnt] = ((M[i] >> k) & 1) + 'a';
        ++cnt;
      }
    printf("%d\n", bestSum);
    for (int i = (0), ei = (4); i < ei; i++) printf("%s\n", Res[i]);
  }
}
int main() {
  run();
  return 0;
}
