unittest
{
	assert( [ "1" ].parse.expand.solve == "a" );
	assert( [ "2" ].parse.expand.solve == "aa\nab" );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	dchar[][] anss;
	auto ds = new dchar[ n ];
	ds[] = 'a';
	anss ~= ds.dup;
	foreach_reverse( m; 0L .. ds.length.signed + 1 )
	{
		foreach( i; 0L .. m - 1 )
		{
			ds[ i ]++;
			anss ~= ds.dup.reverse;
		}
	}
	return anss.join( "\n" );
}
