unittest
{
	assert( [ "7", "nikoandsolstice" ].parse.expand.solve == "nikoand..." );
	assert( [ "40", "ferelibenterhominesidquodvoluntcredunt" ].parse.expand.solve == "ferelibenterhominesidquodvoluntcredunt" );
}



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 k = input.front.to!( long );
	input.popFront;
	auto s = input.front.to!( dchar[] );
	return tuple( k, s );
}

auto solve( long k, dchar[] s )
{
	if( s.length <= k ) return s;
	else                return s[ 0 .. k ] ~ "...";
}
