import std; // AC: 263 ms void calc1(int n) { // 2^17 > 100_000 for (int i = 0; i < n-1; i++) { write('a'); for (int j = 0; j < 17; j++) { if (i & (1 << j)) write('a'); else write('b'); } writeln('a'); } writeln("an"); } // AC: 23 ms void calc2(int n) { auto cs = lowercase; // 26^4 > 100_000 foreach (a, b, c, d; cartesianProduct(cs, cs, cs, cs).take(n-1)) { writeln('a', a, b, c, d, 'a'); } writeln("an"); } void main() { int n; scan(n); calc2(n); } void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int;