#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e60;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
template <typename T1, typename T2, typename T3, typename T4>
void scf(T1 &x, T2 &y, T3 &z, T4 &w) {
  scf(x);
  scf(y);
  scf(z);
  return scf(w);
}
inline char mygetchar() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
template <typename T>
void chkmax(T &x, const T &y) {
  if (y > x) x = y;
  return;
}
template <typename T>
void chkmin(T &x, const T &y) {
  if (y < x) x = y;
  return;
}
int a, b, c, d;
int A, B, C, D;
int first[5][5];
void OUT() {
  puts("-1");
  exit(0);
}
void MEI() {
  for (int i = (1); i <= (4); ++i)
    for (int j = (i + 1); j <= (4); ++j) scf(first[i][j]);
  A = first[1][2] + first[1][3] - first[2][3];
  if (A & 1) OUT();
  A /= 2;
  B = first[1][2] - A;
  C = first[1][3] - A;
  if (A < 0 || B < 0 || C < 0) OUT();
  return;
}
bool check() {
  {
    d = D;
    int y1 = first[1][4] - d;
    int y2 = first[2][4] - d;
    int y3 = first[3][4] - d;
    if (y1 >= 0 && y2 >= 0 && y3 >= 0) {
      c = y1 + y2 - A - B;
      if (c & 1) return 0;
      c /= 2;
      b = y1 + y3 - A - C;
      if (b & 1) return 0;
      b /= 2;
      a = y1 - b - c;
      if (a < 0 || a > A || b < 0 || b > B || c < 0 || c > C) return 0;
      return 1;
    }
  }
  return 0;
}
void ZI() {
  ;
  ;
  ;
  for (;;) {
    if (check()) break;
    if (D > 200000) OUT();
    ++D;
  }
  printf("%d\n", A + B + C + D);
  for (int i = 0; i < (A + B + C + D); ++i) putchar('a');
  putchar('\n');
  for (int i = 0; i < (A + B); ++i) putchar('b');
  for (int i = 0; i < (C + D); ++i) putchar('a');
  putchar('\n');
  for (int i = 0; i < (A); ++i) putchar('b');
  for (int i = 0; i < (B); ++i) putchar('a');
  for (int i = 0; i < (C); ++i) putchar('b');
  for (int i = 0; i < (D); ++i) putchar('a');
  putchar('\n');
  for (int i = 0; i < (a); ++i) putchar('b');
  for (int i = 0; i < (A - a); ++i) putchar('a');
  for (int i = 0; i < (b); ++i) putchar('b');
  for (int i = 0; i < (B - b); ++i) putchar('a');
  for (int i = 0; i < (c); ++i) putchar('b');
  for (int i = 0; i < (C - c); ++i) putchar('a');
  for (int i = 0; i < (d); ++i) putchar('b');
  putchar('\n');
  return;
}
int main() {
  MEI();
  ZI();
  return 0;
}
