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
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
        int[] d = new int[6];
        int[][] v = new int[4][4];
        int vid = 0;
        for (int i = 0; i < 4; ++i) {
            for (int j = i + 1; j < 4; ++j) {
                d[vid] = in.nextInt();
                v[i][j] = v[j][i] = vid++;
            }
        }
        int[][] eq = new int[6][7];
        for (int set = 1; set < 15; set += 2) {
            for (int i = 0; i < 4; ++i) {
                for (int j = i + 1; j < 4; ++j) {
                    if (((set & (1 << i)) == 0) ^ ((set & (1 << j)) == 0))
                        eq[v[i][j]][set / 2] = 1;
                }
            }
        }
        int[] u = new int[7];
        Arrays.fill(u, -1);
        for (int i = 0; i < 6; ++i) {
            int j;
            for (j = 0; j < 7; ++j) if (u[j] < 0 && eq[i][j] != 0) {
                break;
            }
            if (j >= 7) {
                throw new RuntimeException();
            }
            u[j] = i;
            for (int ii = 0; ii < 6; ++ii)
                if (ii != i) {
                    int dd = -eq[ii][j];
                    int mby = eq[i][j];
                    for (int k = 0; k < 7; ++k)
                        eq[ii][k] = eq[ii][k] * mby + eq[i][k] * dd;
                    d[ii] = d[ii] * mby + d[i] * dd;
                }
        }
        int[] vv = new int[7];
        int bsum = Integer.MAX_VALUE;
        int[] bestvv = new int[7];
        for (int v6 = 0; v6 <= 100000; ++v6) {
            vv[6] = v6;
            boolean ok = true;
            for (int i = 0; i < 6; ++i) {
                int a = d[u[i]] - v6 * eq[u[i]][6];
                int b = eq[u[i]][i];
                if (a % b != 0) {
                    ok = false;
                    break;
                }
                vv[i] = a / b;
                if (vv[i] < 0) {
                    ok = false;
                    break;
                }
            }
            if (ok) {
                int sum = 0;
                for (int x : vv) sum += x;
                if (sum < bsum) {
                    bsum = sum;
                    System.arraycopy(vv, 0, bestvv, 0, 7);
                }
            }
        }
        if (bsum == Integer.MAX_VALUE) {
            out.println(-1);
        } else {
            out.println(bsum);
            for (int r = 0; r < 4; ++r) {
                int[] tmp = bestvv.clone();
                int tmpPos = 0;
                for (int i = 0; i < bsum; ++i) {
                    while (tmp[tmpPos] == 0) ++tmpPos;
                    --tmp[tmpPos];
                    if (((tmpPos * 2 + 1) & (1 << r)) != 0)
                        out.print('a');
                    else
                        out.print('b');
                }
                out.println();
            }
        }
	}
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }

