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

public class TestGen implements Runnable {
	public static void main(String[] args) {
		new Thread(new TestGen()).start();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void solve() throws IOException {
		Random rnd = new Random(123456);
		int ModCount = 10;
		for (int i = 2; i <= 25; i++) {
			if (i >= 10)
				out = new PrintWriter(String.valueOf(i));
			else
				out = new PrintWriter(String.valueOf(0).concat(String.valueOf(i)));
			int TCount = 1;
			if (i <= 23)
				TCount = 10;
			if (i <= 21)
				TCount = 3;
			if (i <= 15)
				TCount = 1;
			if (i <= 13)
				TCount = 10;
			if (i <= 12)
				TCount = 3;
			out.println(TCount);
			for (int j = 0; j < TCount; j++) {
				int TNumber = i * 3 + j;
				int n = 100000;
				if (i <= 23)
					n = 10000;
				if (i <= 22)
					n = rnd.nextInt(3000) + 7000;
				if (i <= 21)
					n = 33000;
				if (i <= 18)
					n = rnd.nextInt(15000) + 18000;
				if (i <= 15)
					n = 100;
				if (i <= 13)
					n = rnd.nextInt(30) + 70;
				if (TNumber % ModCount == 0) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 3 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 3 == 1) {
							out.print("BA");
							n -= 2;
						}
						if (t % 2 == 0) {
							out.print("A");
							n -= 1;
						}
					}
					if (n > 0)
							out.print("B");
						out.println();
					
				}

				if (TNumber % ModCount == 2) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 2 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 2 == 1) {
							out.print("BA");
							n -= 2;
						}
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
							out.print("A");
						out.println();
					
				}

				if (TNumber % ModCount == 4) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 2 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 2 == 1) {
							out.print("A");
							n -= 1;
						}
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
							out.print("B");
						out.println();
					
				}

				if (TNumber % ModCount == 6) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 2 == 0) {
							out.print("A");
							n -= 1;
						}
						if (t % 2 == 1) {
							out.print("BA");
							n -= 2;
						}
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
						out.print("B");
					out.println();

				}

				if (TNumber % ModCount == 8) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 1 == 0) {
							out.print("AB");
							n -= 2;
						}
						/*
						 * if (t % 2 == 1) { out.print("BA"); n -= 2; }
						 */
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
						out.print("A");
					out.println();

				}

				if (TNumber % ModCount == 1) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 1 == 0) {
							out.print("BA");
							n -= 2;
						}
						/*
						 * if (t % 2 == 1) { out.print("BA"); n -= 2; }
						 */
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
						out.print("B");
					out.println();

				}

				if (TNumber % ModCount == 3) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 1 == 0) {
							out.print("A");
							n -= 1;
						}
						/*
						 * if (t % 2 == 1) { out.print("BA"); n -= 2; }
						 */
						/*
						 * if (t % 2 == 0) { out.print("A"); n -= 1; }
						 */
					}
					if (n > 0)
						out.print("A");
					out.println();

				}

				if (TNumber % ModCount == 5) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 4 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 4 == 1) {
							out.print("BA");
							n -= 2;
						}
						if (t % 4 == 2) {
							out.print("A");
							n -= 1;
						}
						if (t % 2 == 3) {
							out.print("BBB");
							n -= 3;
						}

					}
					if (n > 0)
						out.print("A");
					if (n > 1)
						out.print("A");
					out.println();

				}

				if (TNumber % ModCount == 7) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 4 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 4 == 1) {
							out.print("BA");
							n -= 2;
						}
						if (t % 4 == 2) {
							out.print("A");
							n -= 1;
						}
						if (t % 4 == 3) {
							out.print("BBB");
							n -= 3;
						}

					}	if (n > 0)
							out.print("B");
						if (n > 1)
							out.print("A");
						out.println();
					
				}

				if (TNumber % ModCount == 9) {
					while (n > 1) {
						int t = rnd.nextInt(25);
						if (t % 4 == 0) {
							out.print("AB");
							n -= 2;
						}
						if (t % 4 == 1) {
							out.print("BA");
							n -= 2;
						}
						if (t % 4 == 2) {
							out.print("A");
							n -= 1;
						}
						if (t % 2 == 3) {
							out.print("BBA");
							n -= 3;
						}

					}
					if (n > 0)
							out.print("B");
						if (n > 1)
							out.print("A");
						out.println();
					
				}

			}
			out.close();
		}
	}

	public void run() {
		try {

			solve();

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