Hamming distance between strings a and b of equal length (denoted by h(a, b)) is equal to the number of distinct integers i (1 ≤ i ≤ |a|), such that ai ≠ bi, where ai is the i-th symbol of string a, bi is the i-th symbol of string b. For example, the Hamming distance between strings "aba" and "bba" equals 1, they have different first symbols. For strings "bbba" and "aaab" the Hamming distance equals 4.

John Doe had a paper on which four strings of equal length s1, s2, s3 and s4 were written. Each string si consisted only of lowercase letters "a" and "b". John found the Hamming distances between all pairs of strings he had. Then he lost the paper with the strings but he didn't lose the Hamming distances between all pairs.

Help John restore the strings; find some four strings s'1, s'2, s'3, s'4 of equal length that consist only of lowercase letters "a" and "b", such that the pairwise Hamming distances between them are the same as between John's strings. More formally, set s'i must satisfy the condition <image>. 

To make the strings easier to put down on a piece of paper, you should choose among all suitable sets of strings the one that has strings of minimum length. 

Input

The first line contains space-separated integers h(s1, s2), h(s1, s3), h(s1, s4). The second line contains space-separated integers h(s2, s3) and h(s2, s4). The third line contains the single integer h(s3, s4).

All given integers h(si, sj) are non-negative and do not exceed 105. It is guaranteed that at least one number h(si, sj) is positive.

Output

Print -1 if there's no suitable set of strings.

Otherwise print on the first line number len — the length of each string. On the i-th of the next four lines print string s'i. If there are multiple sets with the minimum length of the strings, print any of them. 

Examples

Input

4 4 4
4 4
4


Output

6
aaaabb
aabbaa
bbaaaa
bbbbbb
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int d12, d13, d14, d23, d24, d34;
int e1, e2, e3;
bool checkthree(int r1, int r2, int r3) {
  if (r3 > r1 + r2) return false;
  if (r3 < abs(r1 - r2)) return false;
  if ((r1 + r2 - r3) % 2 == 1) return false;
  return true;
}
bool accept(int k, int &a, int &b, int &c) {
  c = d14 + d24 - 2 * k - e1 - e2;
  b = d14 + d34 - 2 * k - e1 - e3;
  a = d24 + d34 - 2 * k - e2 - e3;
  if (a < 0 || b < 0 || c < 0) return false;
  if (a % 2 == 1 || b % 2 == 1 || c % 2 == 1) return false;
  a /= 2;
  b /= 2;
  c /= 2;
  if (a > e1 || b > e2 || c > e3) return false;
  return true;
}
int main() {
  cin >> d12 >> d13 >> d14 >> d23 >> d24 >> d34;
  if (!checkthree(d12, d23, d13)) {
    cout << -1 << endl;
    return 0;
  }
  e1 = d12 - (d12 + d23 - d13) / 2;
  e2 = (d12 + d23 - d13) / 2;
  e3 = d23 - (d12 + d23 - d13) / 2;
  if (e1 < 0 || e2 < 0 || e3 < 0) {
    cout << -1 << endl;
    return 0;
  }
  int mx = min(d14, min(d24, d34));
  int a, b, c;
  for (int k = 0; k <= mx; k++) {
    if (accept(k, a, b, c)) {
      string s1, s2, s3, s4;
      for (int i = 0; i < e1; i++) {
        s1 += 'a';
        s2 += 'b';
        s3 += 'b';
      }
      for (int i = 0; i < e2; i++) {
        s1 += 'b';
        s2 += 'a';
        s3 += 'b';
      }
      for (int i = 0; i < e3; i++) {
        s1 += 'b';
        s2 += 'b';
        s3 += 'a';
      }
      for (int i = 0; i < a; i++) s4 += 'a';
      for (int i = 0; i < e1 - a; i++) s4 += 'b';
      for (int i = 0; i < b; i++) s4 += 'a';
      for (int i = 0; i < e2 - b; i++) s4 += 'b';
      for (int i = 0; i < c; i++) s4 += 'a';
      for (int i = 0; i < e3 - c; i++) s4 += 'b';
      for (int i = 0; i < k; i++) {
        s1 += 'b';
        s2 += 'b';
        s3 += 'b';
        s4 += 'a';
      }
      cout << s1.length() << endl;
      cout << s1 << endl << s2 << endl << s3 << endl << s4 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
