import Control.Monad
import Data.Char

main = (sub =<< get) >>= put

get = fmap read . words <$> getLine

put = mapM_ putStrLn

sub [h,w] = sol w . fmap (filter isLetter) <$> replicateM h getLine

sol w ss = let l = replicate (w+2) '#' in
  l:fmap (\s -> "#"++s++"#") ss ++ [l]
