#include <bits/stdc++.h>
using namespace std;
const int a[6] = {3, 3, 3, 2, 2, 1};
const int b[6] = {2, 1, 0, 1, 0, 0};
const int inf = 1000000000;
const double eps = 1e-6;
int Dist[6];
double X[7];
int Round(double X) {
  int T = (int)X;
  if (T + 1 - X < eps) T++;
  return T;
}
bool Check(int Len) {
  static double G[7][7], A[7];
  memset(G, 0, sizeof(G));
  for (int i = 0; i < 6; i++)
    for (int j = 0; j < 7; j++) {
      bool F0 = (j + 1) & (1 << a[i]);
      bool F1 = (j + 1) & (1 << b[i]);
      G[i][j] = F0 ^ F1;
    }
  for (int i = 0; i < 7; i++) G[6][i] = 1;
  for (int i = 0; i < 6; i++) A[i] = Dist[i];
  A[6] = Len;
  for (int i = 0; i < 7; i++) {
    if (!G[i][i]) {
      int P = i + 1;
      while (!G[P][i]) P++;
      for (int j = i; j < 7; j++) swap(G[i][j], G[P][j]);
      swap(A[i], A[P]);
    }
    for (int j = i + 1; j < 7; j++)
      if (G[j][i]) {
        double T = G[j][i] / G[i][i];
        for (int k = i; k < 7; k++) G[j][k] -= G[i][k] * T;
        A[j] -= A[i] * T;
      }
  }
  for (int i = 6; i >= 0; i--) {
    X[i] = A[i] / G[i][i];
    for (int j = 0; j < i; j++) A[j] -= X[i] * G[j][i];
  }
  for (int i = 0; i < 7; i++)
    if (fabs(X[i] - Round(X[i])) > eps || X[i] < -eps) return false;
  return true;
}
int main() {
  for (int i = 0; i < 6; i++) scanf("%d", &Dist[i]);
  int Ans = -1, Sum = 0;
  for (int i = 0; i < 6; i++) Sum += Dist[i];
  for (int i = Sum / 4; Ans == -1 && i <= Sum / 3; i++)
    if (Check(i)) Ans = i;
  printf("%d\n", Ans);
  if (Ans == -1) return 0;
  string S[4];
  for (int i = 0; i < 7; i++) {
    int M = Round(X[i]);
    for (int j = 0; j < M; j++) {
      S[0] += 'a';
      for (int k = 1; k < 4; k++)
        S[k] += ((i + 1) & (1 << (3 - k))) ? 'b' : 'a';
    }
  }
  for (int i = 0; i < 4; i++) cout << S[i] << endl;
  return 0;
}
