/*--------------------------------------------------------------*/
/* ACM ICPC 2007-2008                                           */
/* Northeastern European Regional Contest                       */
/* St Petersburg - Barnaul - Tashkent - Batumi, November 28, 200*/
/*--------------------------------------------------------------*/
/* Problem B. Building for UN                                   */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Roman Elizarov                         */
/*--------------------------------------------------------------*/
 
/*
    Solution for NEERC'2007 Problem B: Building for UN
    (C) Roman Elizarov
    Note: this solution attempts to check correctness of the input
*/

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

public class building_re {

	public static void main(String[] args) throws Exception {
		new building_re().go();
	}

	void go() throws Exception {
		// read input
		XScanner in = new XScanner(new File("building.in"));
		in.useLocale(Locale.US);
		int n = in.nextInt();
		in.nextLine();
		assert n >= 1 && n <= 50;
		in.close();

		// solve more or less randomly (to check checker)
		Random r = new Random(n);
		char[] c = new char[n];
		for (int i = 0; i < n; i++) {
			boolean ok;
			do {
				int k = r.nextInt(2 * 26);
				c[i] = k < 26 ? (char)(k + 'a') : (char)(k - 26 + 'A'); 
				ok = true;
				for (int j = 0; j < i; j++) {
					if (c[i] == c[j])
						ok = false;
				}
			} while (!ok);
		}
		int[] d = new int[3];
		Arrays.fill(d, n);
		int f = r.nextInt(3);
		d[f] = 2;
		int q = r.nextInt(2);

		char[][][] b = new char[d[0]][d[1]][d[2]];

		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				switch (f) {
				case 0:
					b[q][i][j] = c[i];
					b[1 - q][j][i] = c[i];
					break;
				case 1:
					b[i][q][j] = c[i];
					b[j][1 - q][i] = c[i];
					break;
				case 2:
					b[i][j][q] = c[i];
					b[j][i][1 - q] = c[i];
					break;
				}
			}
		}


		// write output
		PrintWriter out = new PrintWriter("building.out");
		out.println(d[0] + " " + d[1] + " " + d[2]);
		for (int i = 0; i < d[0]; i++) {
			if (i > 0)
				out.println();
			for (int j = 0; j < d[2]; j++) {
				for (int k = 0; k < d[1]; k++)
					out.print(b[i][k][j]);
				out.println();
			}
		}
		out.close();
	}

//----------------- just for validation ------------------

	/**
	 * Strict scanner to veryfy 100% correspondence between input files and input file format specification.
	 * It is a drop-in replacement for {@link java.util.Scanner} that could be added to a soulution source
	 * (cut-and-paste) without breaking its ability to work with {@link java.util.Scanner}.
	 */
	public class XScanner {
		private final BufferedReader in;
		private String line = "";
		private int pos;
		private int lineNo;
		private boolean localeset;

		public XScanner(File source) throws FileNotFoundException {
			in = new BufferedReader(new FileReader(source));
			nextLine();
		}

		public void close() {
			assert line == null : "Extra data at the end of file";
			try {
				in.close();
			} catch (IOException e) {
				throw new AssertionError("Failed to close with " + e);
			}
		}

		public void nextLine() {
			assert line != null : "EOF";
			assert pos == line.length() : "Extra characters on line " + lineNo;
			try {
				line = in.readLine();
			} catch (IOException e) {
				throw new AssertionError("Failed to read line with " + e);
			}
			pos = 0;
			lineNo++;
		}

		public String next() {
			assert line != null : "EOF";
			assert line.length() > 0 : "Empty line " + lineNo;
			if (pos == 0)
				assert line.charAt(0) > ' ' : "Line " + lineNo + " starts with whitespace";
			else {
				assert pos < line.length() : "Line " + lineNo + " is over";
				assert line.charAt(pos) == ' ' : "Wrong whitespace on line " + lineNo;
				pos++;
				assert pos < line.length() : "Line " + lineNo + " is over";
				assert line.charAt(0) > ' ' : "Line " + lineNo + " has double whitespace";
			}
			StringBuilder sb = new StringBuilder();
			while (pos < line.length() && line.charAt(pos) > ' ')
				sb.append(line.charAt(pos++));
			return sb.toString();
		}

		public int nextInt() {
			String s = next();
			assert s.length() == 1 || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
			assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
			try {
				return Integer.parseInt(s);
			} catch (NumberFormatException e) {
				throw new AssertionError("Malformed number " + s + " on line " + lineNo);
			}
		}

		public double nextDouble() {
			assert localeset : "Locale must be set with useLocale(Locale.US)";
			String s = next();
			assert s.length() == 1 || s.startsWith("0.") || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
			assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
			try {
				return Double.parseDouble(s);
			} catch (NumberFormatException e) {
				throw new AssertionError("Malformed number " + s + " on line " + lineNo);
			}
		}

		public void useLocale(Locale locale) {
			assert locale == Locale.US;
			localeset = true;
		}
	}
}
