unittest
{
	assert( [ "3 3", "dxx", "axx", "cxx" ].parse.expand.solve == "axxcxxdxx" );
}



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 nl = input.front.split.to!( long[] );
	auto ss = new string[ nl[ 0 ] ];
	foreach( ref s; ss )
	{
		input.popFront;
		s = input.front;
	}
	return tuple( ss );
}

auto solve( string[] ss )
{
	return ss.sort().join;
}
