#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, const U &b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, const U &b) {
  if (a < b) a = b;
}
int main() {
  int h12, h13, h14;
  scanf("%d %d %d", &h12, &h13, &h14);
  int h23, h24;
  scanf("%d %d", &h23, &h24);
  int h34;
  scanf("%d", &h34);
  int same23 = h12 + h13 - h23;
  if (same23 < 0 || same23 & 1) return puts("-1");
  same23 >>= 1;
  int x4_mn = 0, x4_mx = h14;
  int x3_and_x4 = h14 + h24 - h12;
  if (x3_and_x4 & 1) return puts("-1");
  x3_and_x4 >>= 1;
  smax(x4_mn, x3_and_x4 - (h13 - same23));
  smin(x4_mx, x3_and_x4);
  int x1_and_x4 = h14 + h34 - h13;
  if (x1_and_x4 & 1) return puts("-1");
  x1_and_x4 >>= 1;
  smax(x4_mn, x1_and_x4 - (h12 - same23));
  smin(x4_mx, x1_and_x4);
  int x4_sub_x2 = h24 + h34 - h12 - h13;
  if (x4_sub_x2 & 1) return puts("-1");
  x4_sub_x2 >>= 1;
  smax(x4_mn, x4_sub_x2);
  smin(x4_mx, x4_sub_x2 + same23);
  if (x4_mn > x4_mx) return puts("-1");
  int x4 = x4_mn;
  int x1 = x1_and_x4 - x4;
  int x2 = x4 - x4_sub_x2;
  int x3 = x3_and_x4 - x4;
  int len = h12 + h13 - same23 + x4;
  printf("%d\n", len);
  for (int i = len; i--;) putchar('a');
  puts("");
  for (int i = h12; i--;) putchar('b');
  for (int i = len - h12; i--;) putchar('a');
  puts("");
  for (int i = h12 - same23; i--;) putchar('a');
  for (int i = h13; i--;) putchar('b');
  for (int i = x4; i--;) putchar('a');
  puts("");
  for (int i = x1; i--;) putchar('b');
  for (int i = h12 - same23 - x1; i--;) putchar('a');
  for (int i = x2; i--;) putchar('b');
  for (int i = same23 - x2; i--;) putchar('a');
  for (int i = x3; i--;) putchar('b');
  for (int i = h13 - same23 - x3; i--;) putchar('a');
  for (int i = x4; i--;) putchar('b');
}
