import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Random;

public class gen_rhyme {
	public static void main(String[] args) {
		new gen_rhyme().genTests();
	}

	PrintWriter out;
	int test = 0;
	Random rand = new Random(3245234);

	void next() {
		if (out != null) {
			out.close();
		}
		test++;
		System.out.println((test / 10) + "" + (test % 10));
		try {
			out = new PrintWriter((test / 10) + "" + (test % 10));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
	}

	int VSN = 100;
	int SN = 1000;
	int BN = 100000;

	int VSS = 100;
	int SS = 1000;
	int BS = 100000;

	int LEN = 30;

	String vowels = "aeiouy";

	private void genTests() {
		verySmallTests();
		someTests();
		smallTests();
		bigTest();
		out.close();
	}

	private void someTests() {
		smallTest12_13(true, VSN, VSS);
		smallTest12_13(false, VSN, VSS);
		smallTest14(VSN, VSS);
		// highlyNotVoweledWords(VSN, VSS);
		// highlyVoweledWords(VSN, VSS);
		sameEnds(VSN, VSS - 1);
		stupid(VSS);
		verystupid(VSS);
		while (test < 20) {
			randomTest(VSN, VSS);
		}
	}

	private void verySmallTests() {
		smallestTest1();
		smallestTest2();
		smallestTest3();
		smallestTest4();
		smallestTest5();
		smallestTest6();
		smallestTest7();
		smallestTest8();
		smallestTest9();
		smallestTest10();
		smallestTest11();
	}

	private void smallestTest1() {
		next();
		out.println("0 1");
	}

	private void smallestTest2() {
		next();
		out.println("1 1");
		out.println("cat");
	}

	private void smallestTest3() {
		next();
		out.println("2 1");
		out.println("cat");
		out.println("at");
	}

	private void smallestTest4() {
		next();
		out.println("2 2");
		out.println("cat");
		out.println("at");
	}

	private void smallestTest5() {
		next();
		out.println("2 3");
		out.println("uei");
		out.println("yoi");
	}

	private void smallestTest6() {
		next();
		out.println("3 6");
		out.println("aaa");
		out.println("aaaa");
		out.println("aaaaa");
	}

	private void smallestTest7() {
		next();
		out.println("7 2");
		out.println("a");
		out.println("e");
		out.println("u");
		out.println("o");
		out.println("i");
		out.println("y");
		out.println("aa");
	}

	private void smallestTest8() {
		next();
		out.println("6 5");
		out.println("ab");
		out.println("ac");
		out.println("abb");
		out.println("abc");
		out.println("acb");
		out.println("acc");
	}

	private void smallestTest9() {
		next();
		out.println("4 6");
		out.println("averylong");
		out.println("wordforasampleinput");
		out.println("somethingaboutstrong");
		out.println("andsomethingneedstobecut");
	}

	private void smallestTest10() {
		next();
		out.println("2 30");
		out.println("a");
		out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
	}

	private void smallestTest11() {
		next();
		out.println("2 6");
		out.println("aba");
		out.println("abacaba");
	}

	private void smallTests() {
		smallTest12_13(true, SN, SS);
		smallTest12_13(false, SN, SS);
		smallTest14(SN, SS);
		smallTest15();
		highlyNotVoweledWords(SN, SS);
		highlyVoweledWords(SN, SS);
		sameEnds(SN, SS - 3);
		// stupid(SS);
		// verystupid(SS);
		while (test < 36) {
			randomTest(SN / 2 + rand.nextInt(SN / 2),
					SS / 2 + rand.nextInt(SS / 2));
		}
		while (test < 40) {
			randomTest(SN, SS);
		}
	}

	private void verystupid(int s) {
		next();
		out.println(LEN + " " + s);
		String a = "";
		for (int i = 0; i < LEN; i++) {
			a += "a";
			out.println(a);
		}
	}

	private void stupid(int s) {
		next();
		out.println("2 " + s);
		out.println("aaaaaaaaaaaaaaaaaaaaaaaaa");
		out.println("a");
	}

	private void sameEnds(int n, int s) {
		next();
		int cnt = 0;
		int x = 1;
		while (x < n) {
			x *= 6;
			cnt++;
		}
		String[] a = new String[n];
		String end = stringWithVowels(0);
		while (end.length() < LEN - 2 * cnt || end.length() > LEN - cnt) {
			end = stringWithVowels(0);
		}
		for (int i = 0; i < a.length; i++) {
			int z = i;
			a[i] = "";
			for (int j = 0; j < cnt; j++) {
				a[i] = a[i] + vowels.charAt(z % 6);
				z /= 6;
			}
			a[i] += end;
		}
		print(n, s, a);
	}

	private void highlyVoweledWords(int n, int s) {
		next();
		String[] a = new String[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = stringWithVowels(10 + rand.nextInt(10));
			while (a[i].length() < LEN) {
				char ch = (char) ('a' + rand.nextInt(26));
				while (vowels.indexOf(ch) >= 0) {
					ch = (char) ('a' + rand.nextInt(26));
				}
				a[i] = a[i] + ch;
			}
		}
		print(n, s, a);
	}

	private void highlyNotVoweledWords(int n, int s) {
		next();
		String[] a = new String[n];
		String end = vowels.charAt(rand.nextInt(vowels.length()))
				+ stringWithVowels(0);
		while (end.length() > LEN - 5) {
			end = vowels.charAt(rand.nextInt(vowels.length()))
					+ stringWithVowels(0);
		}
		for (int i = 0; i < a.length; i++) {
			a[i] = stringWithVowels(2 + rand.nextInt(2));
			while (a[i].length() < LEN) {
				char ch = (char) ('a' + rand.nextInt(26));
				while (vowels.indexOf(ch) >= 0) {
					ch = (char) ('a' + rand.nextInt(26));
				}
				a[i] = a[i] + ch;
			}
		}
		int i = rand.nextInt(n);
		int j = rand.nextInt(n);
		while (i == j) {
			j = rand.nextInt(n);
		}
		a[i] = "a" + end;
		a[j] = "c" + end;
		print(n, s, a);
	}

	private void smallTest15() {
		next();
		ArrayList<Integer> good = new ArrayList<Integer>();
		good.add(29);
		good.add(18);
		boolean[] u = new boolean[31];
		u[0] = true;
		u[29] = true;
		u[18] = true;
		boolean[] w = new boolean[48];
		w[0] = true;
		for (int i = 0; i < w.length; i++) {
			if (w[i]) {
				if (i + 18 < w.length) {
					w[i + 18] = true;
				}
				if (i + 29 < w.length) {
					w[i + 29] = true;
				}
			}
		}
		for (int qqq = 0; qqq < 50; qqq++) {
			int x = rand.nextInt(u.length);
			if (u[x]) {
				continue;
			}
			u[x] = true;
			boolean or = false;
			for (int i = 1; 47 - i * x >= 0; i++) {
				or |= w[47 - i * x];
			}
			if (or) {
				continue;
			}
			good.add(x);
		}
		int n = SN;
		int s = 47;
		String[] a = new String[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = stringWithVowels(good.get(rand.nextInt(good.size())));
		}
		print(n, s, a);
	}

	private void smallTest14(int SN, int SS) {
		next();
		int d = 2 + rand.nextInt(29);
		int max = 30 / d;
		int n = SN;
		int s = SS - (SS % d) + 1 + rand.nextInt(d - 1);
		if (s > SS) {
			s -= d;
		}
		HashSet<String> hs = new HashSet<String>();
		String[] a = new String[n];
		for (int i = 0; i < a.length - 2; i++) {
			a[i] = stringWithVowels((1 + rand.nextInt(max)) * d);
			while (hs.contains(a[i])) {
				a[i] = stringWithVowels((1 + rand.nextInt(max)) * d);
			}
			hs.add(a[i]);
		}
		int v1 = 1 + rand.nextInt(LEN);
		v1 = v1 - (v1 % d) + s % d;
		int v2 = 1 + rand.nextInt(LEN);
		v2 = v2 - (v2 % d) + s % d;
		a[n - 2] = stringWithVowels(v1);
		String end = null;
		for (int i = 0; i < a[n - 2].length(); i++) {
			if (vowels.indexOf(a[n - 2].charAt(i)) >= 0) {
				end = a[n - 2].substring(i);
			}
		}
		do {
			a[n - 1] = stringWithVowels(v2 - 1) + end;
		} while (a[n - 1].length() > LEN);
		for (int i = 0; i < a.length; i++) {
			int j = rand.nextInt(i + 1);
			String t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
		print(n, s, a);
	}

	private void smallTest12_13(boolean impossible, int SN, int SS) {
		next();
		int n = SN;
		int[] p = new int[] { 29, 23, 19 };
		boolean[] w = new boolean[SS + 1];
		w[0] = true;
		for (int i = 0; i < w.length; i++) {
			if (!w[i]) {
				continue;
			}
			for (int j : p) {
				if (i + j < w.length) {
					w[i + j] = true;
				}
			}
		}
		String[] a = new String[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = stringWithVowels(p[rand.nextInt(p.length)]);
		}
		int s = w.length - 1;
		if (impossible) {
			while (w[s]) {
				s--;
			}
		} else {
			s = 1 + rand.nextInt(SS);
			while (!w[s]) {
				s = 1 + rand.nextInt(SS);
			}
		}
		print(n, s, a);
	}

	private String stringWithVowels(int v) {
		int len = v + rand.nextInt(LEN - v + 1);
		char[] s = new char[len];
		for (int i = 0; i < v; i++) {
			s[i] = vowels.charAt(rand.nextInt(vowels.length()));
		}
		for (int i = v; i < s.length; i++) {
			s[i] = (char) ('a' + rand.nextInt(26));
			while (vowels.indexOf(s[i]) >= 0) {
				s[i] = (char) ('a' + rand.nextInt(26));
			}
		}
		for (int i = 0; i < s.length; i++) {
			int j = rand.nextInt(i + 1);
			char t = s[i];
			s[i] = s[j];
			s[j] = t;
		}
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < s.length; i++) {
			sb.append(s[i]);
		}
		return sb.toString();
	}

	private void bigTest() {
		sameEnds(BN, BS);
		smallTest12_13(true, BN, BS);
		smallTest12_13(false, BN, BS);
		smallTest14(BN, BS);
		highlyNotVoweledWords(BN, BS - 17);
		highlyVoweledWords(BN, BS - 7);
		while (test < 50) {
			randomTest(BN, BS);
		}
	}

	private void randomTest(int n, int s) {
		next();
		HashSet<String> hs = new HashSet<String>();
		String[] a = new String[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = stringWithVowels(2 + rand.nextInt(LEN - 1));
			while (hs.contains(a[i])) {
				a[i] = stringWithVowels(2 + rand.nextInt(LEN - 1));
			}
			hs.add(a[i]);
		}
		out.println(n + " " + s);
		for (int i = 0; i < a.length; i++) {
			out.println(a[i]);
		}
	}

	private void print(int n, int s, String[] a) {
		out.println(n + " " + s);
		for (int i = 0; i < a.length; i++) {
			out.println(a[i]);
		}
	}

}
