import java.io.*;
import java.util.*;
import java.math.*;
//VU template ver0.01

public class gen_rand {

	public static void main(String[] args) throws IOException {
		Random rand = new Random(8746);
		int maxn = 50;
		for (int k = 6; k <= 30; k++) {
			PrintWriter out = new PrintWriter(new File(k / 10 + "" + k % 10));
			
			int n = 1 + rand.nextInt(maxn);
			String s = "";
			for (int i = 0; i < n * n; i++) {
				s += (char) ('a' + rand.nextInt(26));
			}
			out.println(n);
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					if (i % 2 == 0) {
						out.print(s.charAt(i * n + j));
					} else {
						out.print(s.charAt((i + 1) * n - j - 1));
					}
				}
				out.println();
			}
			int ran = rand.nextInt(n * n);

			int x = rand.nextInt(n * n);
			int y = x + rand.nextInt(n * n - x);
			for (int i = x; i <= y; i++) {
				if (i == ran) {
					out.print((char) ('a' + rand.nextInt(26)));
				} else {
					out.print(s.charAt(i));
				}
			}
			out.println();

                        
			out.close();
		}
	}

}
