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

public class gen_chess implements Runnable {
	public static void main(String[] args) {
		if (args.length < 1) {
			for (I = 1; (new File(getName(I) + ".t")).exists(); I++)
				;
		} else {
			if (args[0].equals("stress")) {
				STRESS_MODE = true;
				if (args.length >= 2) {
					FNAME = args[1];
				} else {
					FNAME = "01";
				}
			} else {
				I = Integer.parseInt(args[0]);
			}
		}
		new Thread(new gen_chess()).start();
	}

	PrintWriter out;

	Random rand = new Random(6439586L);
	
	static int I;

	static boolean STRESS_MODE;
	static String FNAME;
	
	
	static String getName(int i) {
		return ((i < 10) ? "0" : "") + i;
	}

	void open() {
		try {
			if (STRESS_MODE) {
				out = new PrintWriter(FNAME);
			} else {
				System.out.println("Generating test " + I);
				out = new PrintWriter(getName(I));
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	void close() {
		out.close();
		I++;
	}

	final String ALPHA = "abcdefghijklmnopqrstuvwxyz";

	String randString(int len, String alpha) {
		StringBuilder ans = new StringBuilder();
		int k = alpha.length();
		for (int i = 0; i < len; i++) {
			ans.append(alpha.charAt(rand.nextInt(k)));
		}
		return ans.toString();
	}

	long rand(long l, long r) {
		return l + (rand.nextLong() >>> 1) % (r - l + 1);
	}

	int rand(int l, int r) {
		return l + rand.nextInt(r - l + 1);
	}
	
	void saveTest(int n, int[] x, int[] y) {
		open();
		out.println(n);
		for (int i = 0; i < n + 1; ++i) {
			out.println((char)('a' + x[i]) + "" + (char)('1' + y[i]));
		}
		close();
	}
	
	class Pos {
		int x, y;
	}

	void genPosTest(int n, int L, int R) {
		CheckMove f = FIG[rand(L, R)];
		int[] x = new int[n + 1];
		int[] y = new int[n + 1];
		x[0] = rand(0, 7);
		y[0] = rand(0, 7);
		if (L < 2) {
			y[0] = rand(1, 6);
		}
		ArrayList<Pos> al = new ArrayList<Pos>();
		for (int i = 0; i < 8; ++i) {
			for (int j = 0; j < 8; ++j) {
				Pos p = new Pos();
				p.x = i;
				p.y = j;
				al.add(p);
			}
		}
		loop:
		for (int i = 0; i < n; ++i) {
			Collections.shuffle(al);
			for (Pos p : al) {
				if (f.canGo(x[i], y[i], p.x, p.y)) {
					x[i + 1] = p.x;
					y[i + 1] = p.y;
					continue loop;
				}
			}
			n = i;
			break;
			//throw new Error("No way could I find such a long sequence of moves!");
		}
		saveTest(n, x, y);
	}
	
	void genRandTest(int n) {
		int[] x = new int[n + 1];
		int[] y = new int[n + 1];
		for (int i = 0; i < n + 1; ++i) {
			x[i] = rand(0, 7);
			y[i] = rand(0, 7);
		}
		saveTest(n, x, y);
	}
	
	public void solve() throws IOException {
		for (int i = 0; i < 7; ++i) {
			genPosTest(1, i, i);
		}		
		for (int i = 0; i < 4; ++i) {
			genPosTest(10, i % 2, i % 2);
		}
		
		for (int i = 0; i < 10; ++i) {
			genPosTest(rand(MAXN / 2, MAXN), 2 + (i % 5), 2 + (i % 5));
		}
		genPosTest(MAXN, 6, 6);
	}
	
	final CheckMove[] FIG = new CheckMove[]{new WhitePawn(), new BlackPawn(), new Knight(), new Bishop(), new Rook(), new Queen(), new King()};

	final int MAXN = 1000;
	
	interface CheckMove {	
		boolean canGo(int x1, int y1, int x2, int y2);
		String getName();
	}
	
	class WhitePawn implements CheckMove {

		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return y1 > 0 && x1 == x2 && (y1 + 1 == y2 || y1 == 1 && y1 + 2 == y2);
		}

		@Override
		public String getName() {
			return "white pawn";
		}
		
	}
	
	class BlackPawn implements CheckMove {

		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return y1 < 7 && x1 == x2 && (y1 - 1 == y2 || y1 == 6 && y1 - 2 == y2);
		}

		@Override
		public String getName() {
			return "black pawn";
		}
		
	}
	
	class Knight implements CheckMove {

		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return Math.abs(x1 - x2) == 2 && Math.abs(y1 - y2) == 1 || Math.abs(x1 - x2) == 1 && Math.abs(y1 - y2) == 2; 
		}

		@Override
		public String getName() {
			return "knight";
		}
		
	}
	
	class Bishop implements CheckMove {
		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return (x1 != x2 || y1 != y2) && (x1 + y1 == x2 + y2 || x1 - y1 == x2 - y2);
		}

		@Override
		public String getName() {
			return "bishop";
		}
	}
	
	class Rook implements CheckMove {
		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return (x1 != x2 || y1 != y2) && (x1 == x2 || y1 == y2);
		}

		@Override
		public String getName() {
			return "rook";
		}
	}
	
	class Queen implements CheckMove {

		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return (x1 != x2 || y1 != y2) && (x1 == x2 || y1 == y2 || x1 + y1 == x2 + y2 || x1 - y1 == x2 - y2);
		}

		@Override
		public String getName() {
			return "queen";
		}
		
	}
	
	class King implements CheckMove {

		@Override
		public boolean canGo(int x1, int y1, int x2, int y2) {
			return Math.abs(x1 - x2) <= 1 && Math.abs(y1 - y2) <= 1 && (x1 != x2 || y1 != y2);
		}

		@Override
		public String getName() {
			return "king";
		}
	}
	
	void myAssert(boolean e) {
		if (!e) {
			throw new Error("Assertion failed");
		}
	}

	public void run() {
		try {
			solve();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
}