#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 10;
const int maxv = 1e3 + 10;
const double eps = 1e-9;
int mat[6][7] = {{0, 0, 0, 1, 1, 1, 1}, {0, 1, 1, 0, 0, 1, 1},
                 {1, 0, 1, 0, 1, 0, 1}, {0, 1, 1, 1, 1, 0, 0},
                 {1, 0, 1, 1, 0, 1, 0}, {1, 1, 0, 0, 1, 1, 0}};
int mp[6][7];
int res[10];
char S[8][5] = {"aaab", "aaba", "aabb", "abaa", "abab", "abba", "abbb"};
int r[7];
int globalres;
char answer[4][maxn];
void print() {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 7; j++) {
      printf("%d ", mp[i][j]);
    }
    puts("");
  }
  puts("");
}
bool Gauss(int edu, int var, int K) {
  int row, col;
  for (row = 0, col = 0; row < edu && col < var; row++, col++) {
    int max_row = row;
    for (int i = row + 1; i < edu; i++) {
      if (abs(mp[i][col]) > abs(mp[max_row][col])) max_row = i;
    }
    if (!mp[max_row][col]) return 0;
    if (max_row != row) {
      for (int i = col; i <= var; i++) {
        swap(mp[max_row][i], mp[row][i]);
      }
    }
    for (int j = var; j >= col; j--) {
      if (abs(mp[row][j]) % abs(mp[row][col])) return 0;
      mp[row][j] /= mp[row][col];
    }
    for (int i = row + 1; i < edu; i++) {
      if (!mp[i][col]) continue;
      for (int j = var; j >= col; j--) {
        mp[i][j] -= mp[row][j] * mp[i][col];
      }
    }
  }
  for (int i = var - 1; i >= 0; i--) {
    res[i] = mp[i][var];
    for (int j = i + 1; j < var; j++) {
      res[i] -= mp[i][j] * res[j];
    }
    res[i] /= mp[i][i];
  }
  for (int i = 0; i < var; i++) {
    if (res[i] < 0) return 0;
  }
  int R = 0;
  res[var] = K;
  for (int i = 0; i <= var; i++) {
    R += res[i];
  }
  if (R < globalres) {
    globalres = R;
    for (int i = 0; i <= var; i++) {
      r[i] = res[i];
    }
  }
  return 1;
}
int main() {
  int big = 0;
  globalres = inf;
  for (int i = 0; i < 6; i++) {
    scanf("%d", &mat[i][6]);
    big = max(big, mat[i][6]);
  }
  for (int k = 0; k <= big; k++) {
    memcpy(mp, mat, sizeof mp);
    for (int i = 0; i < 3; i++) {
      mp[i][6] -= k;
    }
    if (!Gauss(6, 6, k)) continue;
  }
  if (globalres >= inf) {
    puts("-1");
    return 0;
  }
  printf("%d\n", globalres);
  int top = 0;
  for (int i = 0; i < 7; i++) {
    while (r[i]--) {
      answer[0][top] = S[i][0];
      answer[1][top] = S[i][1];
      answer[2][top] = S[i][2];
      answer[3][top] = S[i][3];
      top++;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < top; j++) {
      printf("%c", answer[i][j]);
    }
    puts("");
  }
  return 0;
}
