sub L{length}L>$l&&($l=L)for@a=<>;$t='#'x($l+3).$/;$e='# '.$"x$l.'# ';s/$/$"x($l-L).' #'/e,s/^/# /for@a;print$t,$e,@a,$e,$t