{-# LANGUAGE ScopedTypeVariables #-}
import Data.List
import Control.Applicative

main = interact process

process input0
 = replicate (w+1) '#' ++
   (input2 >>= \c -> if c == '\n' then "#\n#" else [c]) ++
   replicate (w+1) '#' ++ "\n"
  where
    (h::Int,input1):_ = reads input0
    (w::Int,input2):_ = reads input1