unittest
{
	assert( [ "2 3", "abc", "arc" ].parse.expand.solve == "#####\n#abc#\n#arc#\n#####" );
	assert( [ "1 1", "z" ].parse.expand.solve == "###\n#z#\n###" );
}



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

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

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto hw = input.front.split.to!( long[] );
	auto ass = new string[ hw[ 0 ] ];
	foreach( ref as; ass )
	{
		input.popFront;
		as = input.front.strip;
	}
	return tuple( ass );
}

auto solve( string[] ass )
{
	// 左右の枠を付ける
	foreach( ref as; ass )
	{
		as = "#" ~ as ~ "#";
	}
	
	// 上下の枠を付ける
	auto tb = '#'.repeat( ass[ 0 ].length ).to!string;
	ass = tb ~ ass ~ tb;
	
	return ass.join( "\n" );
}
