#include <bits/stdc++.h>
using namespace std;
int a[4][4];
string s1, s2, s3;
vector<int> v[4];
pair<int, int> wrk(int n, int m, int b, int dis) {
  if (n + m < b) return make_pair(-1, -1);
  if ((dis - m + b) % 2 || dis - m + b < 0) return make_pair(-1, -1);
  int x = (dis - m + b) / 2;
  if (x > n || b - x > m || b - x < 0) return make_pair(-1, -1);
  return make_pair(x, b - x);
}
bool check(int mid) {
  for (int i = 0; i < 4; i++) v[i].clear();
  v[0].push_back(mid);
  if (a[0][1] > mid) return 0;
  v[1].push_back(mid - a[0][1]), v[1].push_back(a[0][1]);
  pair<int, int> p = wrk(v[1][0], v[1][1], a[0][2], a[1][2]);
  if (p == make_pair(-1, -1)) return 0;
  v[2].push_back(v[1][0] - p.first), v[2].push_back(p.first);
  v[2].push_back(v[1][1] - p.second), v[2].push_back(p.second);
  p = wrk(v[1][0], v[1][1], a[0][3], a[1][3]);
  if (p == make_pair(-1, -1)) return 0;
  int la = v[1][0] - p.first, lb = p.first, ra = v[1][1] - p.second,
      rb = p.second;
  for (int b3 = 0; b3 <= rb; b3++) {
    int a1, b1, a2, b2, a3, a4, b4;
    b4 = rb - b3, a3 = v[2][2] - b3, a4 = v[2][3] - b4;
    if (a3 < 0 || a4 < 0) continue;
    int dis = a[2][3] - b3 - a4;
    if (dis < 0) continue;
    p = wrk(v[2][0], v[2][1], lb, dis);
    if (p == make_pair(-1, -1)) continue;
    a1 = v[2][0] - p.first, b1 = p.first, a2 = v[2][1] - p.second,
    b2 = p.second;
    v[3].push_back(a1), v[3].push_back(b1);
    v[3].push_back(a2), v[3].push_back(b2);
    v[3].push_back(a3), v[3].push_back(b3);
    v[3].push_back(a4), v[3].push_back(b4);
    return 1;
  }
  return 0;
}
int main() {
  for (int i = 0; i < 4; i++)
    for (int j = i + 1; j < 4; j++) scanf("%d", &a[i][j]);
  int l = 1, r = 2e7, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (!check(l))
    printf("-1");
  else {
    printf("%d\n", l);
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < v[i].size(); j++)
        for (int k = 0; k < v[i][j]; k++) printf(j % 2 == 0 ? "a" : "b");
      puts("");
    }
  }
  return 0;
}
