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
/* Codeforces Template */

import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	
	static long initTime;
	static final Random rnd = new Random(7777L);
	
	public static void main(String[] args) throws IOException {
		initTime = System.currentTimeMillis();
		new Thread(null, new Runnable() {
			public void run() {
				try {
					try {
						if (new File("input.txt").exists())
							System.setIn(new FileInputStream("input.txt"));
					} catch (SecurityException e) {}
//					long prevTime = System.currentTimeMillis();
					new Main().run();
//					System.err.println("Total time: " + (System.currentTimeMillis() - prevTime) + " ms");
//					System.err.println("Memory status: " + memoryStatus());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start(); 
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
		in.close();
	}
	
	/*************************************************************** 
	 * Solution
	 **************************************************************/

	int S12;
	int S13;
	int S14;
	int S23;
	int S24;
	int S34;
	
	final int MAXX0 = 1000000;
	
	String[] s = {
			"aaab",
			"aaba",
			"aabb",
			"abaa",
			"abab",
			"abba",
			"abbb"
	};
	
	void solve() throws IOException  {
		S12 = nextInt();
		S13 = nextInt();
		S14 = nextInt();
		S23 = nextInt();
		S24 = nextInt();
		S34 = nextInt();
		
		int bLen = Integer.MAX_VALUE;
		int[] bx = new int [7];
		fill(bx, -1);
		
		for (int x0 = 0; x0 <= MAXX0; x0++) {
			int x1 = x1(x0);
			int x2 = x2(x0);
			int x3 = x3(x0);
			int x4 = x4(x0);
			int x5 = x5(x0);
			int x6 = x6(x0);
			
			if (can(x0, x1, x2, x3, x4, x5, x6)) {
				if (bLen > x0 + x1 + x2 + x3 + x4 + x5 + x6) {
					bLen = x0 + x1 + x2 + x3 + x4 + x5 + x6;
					bx[0] = x0;
					bx[1] = x1;
					bx[2] = x2;
					bx[3] = x3;
					bx[4] = x4;
					bx[5] = x5;
					bx[6] = x6;
				}
			}
		}
		
		if (bLen == Integer.MAX_VALUE) {
			out.println("-1");
			return;
		}
		
		out.println(bLen);
		
		for (int i = 0; i < 4; i++) {
			for (int x = 0; x < 7; x++) {
				for (int k = 0; k < bx[x]; k++) {
					out.print(s[x].charAt(i));
				}
			}
			out.println();
		}
		
	}
	
	boolean can(int x0, int x1, int x2, int x3, int x4, int x5, int x6) {
		return g(x0) && g(x1) && g(x2) && g(x3) && g(x4) && g(x5) && g(x6);
	}

	boolean g(int x) {
		return 0 <= x;
	}

	int x1(int x0) {
		int S = -(S24 - S23 + S14 - S13 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	int x2(int x0) {
		int S = (S24 + S14 - S12 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	int x3(int x0) {
		int S = -(S34 - S23 + S14 - S12 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	int x4(int x0) {
		int S = (S34 + S14 - S13 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	int x5(int x0) {
		int S = (S34 + S24 - S23 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	int x6(int x0) {
		int S = -(S34 + S24 - S13 - S12 - 2 * x0);
		return S % 2 == 0 ? (S / 2) : -1;
	}
	
	/*************************************************************** 
	 * Input 
	 **************************************************************/
	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	int[] nextIntArray(int size) throws IOException {
		int[] ret = new int [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextInt();
		return ret;
	}
	
	long[] nextLongArray(int size) throws IOException {
		long[] ret = new long [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextLong();
		return ret;
	}
	
	double[] nextDoubleArray(int size) throws IOException {
		double[] ret = new double [size];
		for (int i = 0; i < size; i++)
			ret[i] = nextDouble();
		return ret;
	}
	
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}
	
	/*************************************************************** 
	 * Output 
	 **************************************************************/
	void printRepeat(String s, int count) {
		for (int i = 0; i < count; i++)
			out.print(s);
	}
	
	void printArray(int[] array) {
		if (array == null || array.length == 0)
			return;
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(long[] array) {
		if (array == null || array.length == 0)
			return;
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(double[] array) {
		if (array == null || array.length == 0)
			return;
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}
	
	void printArray(double[] array, String spec) {
		if (array == null || array.length == 0)
			return;
		for (int i = 0; i < array.length; i++) {
			if (i > 0) out.print(' ');
			out.printf(Locale.US, spec, array[i]);
		}
		out.println();
	}
	
	void printArray(Object[] array) {
		if (array == null || array.length == 0)
			return;
		boolean blank = false;
		for (Object x : array) {
			if (blank) out.print(' '); else blank = true;
			out.print(x);
		}
		out.println();
	}
	
	@SuppressWarnings("rawtypes")
	void printCollection(Collection collection) {
		if (collection == null || collection.isEmpty())
			return;
		boolean blank = false;
		for (Object x : collection) {
			if (blank) out.print(' '); else blank = true;
			out.print(x);
		}
		out.println();
	}
	
	/*************************************************************** 
	 * Utility
	 **************************************************************/
	static String memoryStatus() {
		return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() >> 20) + "/" + (Runtime.getRuntime().totalMemory() >> 20) + " MB";
	}
	
	static void checkMemory() {
		System.err.println(memoryStatus());
	}
	
	static long prevTimeStamp = Long.MIN_VALUE;
	
	static void updateTimer() {
		prevTimeStamp = System.currentTimeMillis();
	}
	
	static long elapsedTime() {
		return (System.currentTimeMillis() - prevTimeStamp);
	}
	
	static void checkTimer() {
		System.err.println(elapsedTime() + " ms");
	}
}
