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

public class TestGen {
	FastScanner in;
	PrintWriter out;

	private int done = 0;

	final static Random rng = new Random(191919);

	final int maxN = 5000;

	void print(int n, String s) {
		String filename = "" + (done + 1);
		if (done < 9) {
			filename = "0" + filename;
		}
		PrintWriter out = null;
		try {
			out = new PrintWriter(new File("..\\tests\\" + filename));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		out.println(n);
		out.println(s);
		out.close();
		done++;
		System.out.println(done);
	}

	public void solve() {
		Locale.setDefault(Locale.US);
		File testDir = new File("..\\tests");
		if (!testDir.exists()) {
			testDir.mkdir();
		}

		//sample
		String s = "abacaba";
		print(12, s);

		// very short
		s = "a";
		for (int i = s.length(); i < 5; i++) {
			print(i, s);
		}
		s = "aba";
		for (int i = s.length(); i < 7; i++) {
			print(i, s);
		}

		// short
		s = "abacaba";
		for (int i = s.length(); i < 20; i++) {
			print(i, s);
		}
		s = "abbbbbbb";
		for (int i = s.length(); i < 20; i++) {
			print(i, s);
		}
		s = "aaaaaa";
		for (int i = s.length(); i < 20; i++) {
			print(i, s);
		}

		// big
		s = "";
		for (char c = 'a'; c <= 'k'; c++) {
			s = s + c + s;
		}
		print(s.length(), s);
		print(s.length() + 1, s);
		print(s.length() + 5, s);
		print(maxN, s);

		int[] ks = new int[] { maxN / 2, maxN - 10, maxN / 4, 3 * maxN / 4 };
		
		StringBuilder sb = new StringBuilder();
		
		for (int k : ks) {
			// ONLY ONE GOOD
			sb = new StringBuilder();
			for (int i = 0; i < k; i++) {
				sb.append('a');
			}
			print(sb.length() + 2, sb.toString());
			print(maxN, sb.toString());

			// WHOLE ALPHABET
			sb = new StringBuilder();
			for (int i = 0; i < k; i++) {
				sb.append((char) ('a' + (i % 26)));
			}
			print(sb.length() + 3, sb.toString());
			print(maxN, sb.toString());

			// ALMOST ALL PREFIXES - GOOD
			sb = new StringBuilder();
			sb.append("a");
			for (int i = 0; i < k; i++) {
				sb.append("b");
			}
			print(sb.length() + 2, sb.toString());
			print(maxN, sb.toString());

			// TUE-MORSE
			sb = new StringBuilder();
			for (int i = 0; i < k; i++) {
				if (Integer.bitCount(i) % 2 == 0) {
					sb.append("a");
				} else {
					sb.append("b");
				}
			}
			print(sb.length() + 4, sb.toString());
			print(maxN, sb.toString());
		}

		// FIBONNACI
		String[] fn = new String[19];
		fn[0] = "b";
		fn[1] = "a";
		for (int i = 2; i < 19; i++) {
			fn[i] = fn[i - 1] + fn[i - 2];
		}
		sb = new StringBuilder(fn[17]);
		print(maxN, sb.toString());
		sb = new StringBuilder(fn[18]);
		print(maxN, sb.toString());

	}

	public void run() {
		try {
			out = new PrintWriter(new File("prefixstrings.in"));

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}

	public static void main(String[] arg) {
		new TestGen().run();
	}
}