#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
double a[7][8] = {{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1},
                  {0, 0, 1, 1, 0, 0, 1, 1}, {0, 0, 0, 0, 1, 1, 1, 1},
                  {0, 1, 1, 0, 0, 1, 1, 0}, {0, 1, 0, 1, 1, 0, 1, 0},
                  {0, 0, 1, 1, 1, 1, 0, 0}};
double b[7];
int x[8];
void print() {
  for (int i = 0; i < 7; ++i) {
    for (int j = 0; j < 8; ++j) {
      printf("%.3f ", a[i][j]);
    }
    printf("   %.3f\n", b[i]);
  }
}
bool check(double x) { return fabs(x - floor(x + EPS)) < EPS; }
double gao() {
  for (int i = 0; i < 7; ++i) {
    int r = i;
    for (int j = i + 1; j < 7; ++j) {
      if (fabs(a[j][i]) > fabs(a[r][i])) {
        r = j;
      }
    }
    if (r != i) {
      for (int j = 0; j < 8; ++j) {
        swap(a[i][j], a[r][j]);
      }
      swap(b[i], b[r]);
    }
    double t = a[i][i];
    for (int j = 0; j < 8; ++j) {
      a[i][j] /= t;
    }
    b[i] /= t;
    for (int j = 0; j < 7; ++j) {
      if (j != i) {
        double t = a[j][i];
        for (int k = 0; k < 8; ++k) {
          a[j][k] -= a[i][k] * t;
        }
        b[j] -= b[i] * t;
      }
    }
  }
  memset(x, -1, sizeof(x));
  int lb = max(-b[1], max(-b[2], -b[4]));
  int ub = min(b[3], min(b[5], b[6]));
  lb = max(lb, 0);
  if (lb > ub) {
    return false;
  }
  x[7] = lb;
  for (int i = 0; i < 7; ++i) {
    x[i] = (int)(b[i] - a[i][7] * x[7] + EPS);
    if (!check(b[i]) || x[i] < 0) {
      return false;
    }
  }
  return true;
}
int main() {
  b[0] = 0.0;
  for (int i = 1; i < 7; ++i) {
    scanf("%lf", &b[i]);
  }
  if (!gao()) {
    puts("-1");
  } else {
    int N = 0;
    for (int i = 0; i < 8; ++i) {
      N += x[i];
    }
    printf("%d\n", N);
    for (int i = 0; i < 4; ++i) {
      for (int j = 0; j < 8; ++j) {
        int t = j << 1;
        for (int k = 0; k < x[j]; ++k) {
          printf("%c", !!(t & 1 << i) + 'a');
        }
      }
      puts("");
    }
  }
  return 0;
}
