#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000;
const int maxn = 10;
int x[maxn], ans[maxn], y[maxn];
int b[maxn][maxn];
char s[maxn][maxn] = {"abbb", "babb", "bbab", "bbba", "aabb", "abab", "baab"};
bool free_x[maxn];
long long gcd(long long aa, long long b) { return b ? gcd(b, aa % b) : aa; }
long long lcm(long long aa, long long b) { return aa / gcd(aa, b) * b; }
bool Gauss() {
  long long a[maxn][maxn];
  for (int i = 0; i < maxn; ++i)
    for (int j = 0; j < maxn; ++j) a[i][j] = b[i][j];
  int equ = 6, var = 6;
  int k, col, temp;
  int max_r, i, j;
  long long LCM, ta, tb;
  for (int i = 0; i < var; i++) {
    x[i] = 0;
  }
  for (k = 0, col = 0; k < equ && col < var; k++, col++) {
    max_r = k;
    for (i = k + 1; i < equ; i++)
      if (abs(a[i][col]) > abs(a[max_r][col])) max_r = i;
    if (max_r != k)
      for (j = k; j < var + 1; j++) swap(a[k][j], a[max_r][j]);
    if (a[k][col] == 0) {
      k--;
      continue;
    }
    for (i = k + 1; i < equ; i++)
      if (a[i][col] != 0) {
        LCM = lcm(abs(a[i][col]), abs(a[k][col]));
        ta = LCM / abs(a[i][col]);
        tb = LCM / abs(a[k][col]);
        if (a[i][col] * a[k][col] < 0) tb = -tb;
        for (j = col; j < var + 1; j++) a[i][j] = a[i][j] * ta - a[k][j] * tb;
      }
  }
  for (i = k; i < equ; i++)
    if (a[i][col] != 0) return false;
  if (k < var) return false;
  for (i = var - 1; i >= 0; i--) {
    temp = a[i][var];
    for (j = i + 1; j < var; j++)
      if (a[i][j] != 0) temp -= a[i][j] * x[j];
    if (temp % a[i][i] != 0) return false;
    x[i] = temp / a[i][i];
  }
  return true;
}
int main() {
  for (int i = 0; i < 6; ++i) cin >> y[i];
  b[0][0] = b[0][1] = b[0][5] = 1;
  b[1][0] = b[1][2] = b[1][4] = 1;
  b[2][0] = b[2][3] = b[2][4] = b[2][5] = 1;
  b[3][1] = b[3][2] = b[3][4] = b[3][5] = 1;
  b[4][1] = b[4][3] = b[4][4] = 1;
  b[5][2] = b[5][3] = b[5][5] = 1;
  int num = inf;
  bool check = false;
  for (x[6] = 0; x[6] <= inf; x[6]++) {
    for (int i = 0; i < 6; ++i) {
      if (i != 2 && i != 3)
        b[i][6] = y[i] - x[6];
      else
        b[i][6] = y[i];
    }
    if (Gauss()) {
      int sum = 0;
      bool flag = false;
      for (int i = 0; i <= 6; ++i) sum += x[i];
      for (int i = 0; i <= 6; ++i)
        if (x[i] < 0) flag = true;
      if (sum < num && !flag) {
        num = sum;
        check = true;
        for (int k = 0; k <= 6; ++k) ans[k] = x[k];
      }
    }
  }
  if (!check) num = -1;
  printf("%d\n", num);
  if (check)
    for (int k = 0; k < 4; ++k) {
      for (int i = 0; i < 7; ++i)
        for (int j = 0; j < ans[i]; ++j) printf("%c", s[i][k]);
      printf("\n");
    }
  return 0;
}
