#include <bits/stdc++.h>
using namespace std;
const int M = 1000000 + 10;
int vec[1 << 4][4];
int v6[1 << 4][6];
int ihash[1 << 6];
int matrix[10][10];
char board[4][M];
int main() {
  time_t t_start, t_end;
  t_start = clock();
  for (int i = 0; i < (1 << 4); i++) {
    for (int j = 0; j < 4; j++) {
      vec[i][j] = ((i >> j) & 1);
    }
    int id = 0;
    int num = 0;
    for (int j = 0; j < 3; j++) {
      for (int k = j + 1; k < 4; k++) {
        v6[i][id] = (vec[i][j] + vec[i][k]) % 2;
        num = num * 2 + v6[i][id];
        id++;
      }
    }
    ihash[num] = i;
  }
  vector<int> pattern;
  int ncol = 0;
  for (int i = 1; i < (1 << 6); i++) {
    if (ihash[i] > 0) {
      pattern.push_back(ihash[i]);
      for (int row = 0; row < 6; row++) {
        matrix[row][ncol] = v6[ihash[i]][row];
      }
      ncol++;
    }
  }
  int inv[6][6] = {{0, 1, -1, 1, -1, 0}, {-1, 0, 1, 0, 1, 0},
                   {1, 0, -1, 1, 0, -1}, {0, -1, 1, 0, 0, 1},
                   {0, 0, 0, -1, 1, 1},  {1, 1, 0, 0, -1, -1}};
  int sval[6];
  for (int i = 0; i < 6; i++) {
    cin >> sval[i];
  }
  int ans = ((1e+9) + 10);
  int root[7];
  for (int rt1 = 0; rt1 < (100000 + 10); rt1++) {
    int tval[6];
    for (int i = 0; i < 6; i++) {
      tval[i] = sval[i] - rt1 * matrix[i][0];
    }
    int tmp[6];
    for (int i = 0; i < 6; i++) {
      tmp[i] = -1;
      int t = 0;
      for (int j = 0; j < 6; j++) {
        t = t + inv[i][j] * tval[j];
      }
      if (t % 2 == 0 && t >= 0) {
        tmp[i] = t / 2;
      }
    }
    bool ok = true;
    for (int i = 0; i < 6; i++) {
      if (tmp[i] < 0) {
        ok = false;
      }
    }
    if (ok == true) {
      int t = rt1;
      for (int i = 0; i < 6; i++) {
        t = t + tmp[i];
      }
      if (t < ans) {
        ans = t;
        root[0] = rt1;
        for (int i = 0; i < 6; i++) {
          root[i + 1] = tmp[i];
        }
      }
    }
  }
  if (ans == ((1e+9) + 10)) {
    cout << "-1" << endl;
  } else {
    int col = 0;
    for (int i = 0; i < 7; i++) {
      int t = root[i];
      int id = pattern[i];
      while (t > 0) {
        for (int j = 0; j < 4; j++) {
          board[j][col] = (vec[id][j] == 1 ? 'a' : 'b');
        }
        col++;
        t--;
      }
    }
    cout << ans << endl;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < ans; j++) {
        cout << board[i][j];
      }
      cout << endl;
    }
    cout << endl;
  }
  t_end = clock();
  return 0;
}
