main = do
  (h:w:_) <- return . (map read) . words =<< getLine
  pic <- return . lines =<< getContents

  mapM_ putStrLn $ concat [[take (w+2) (repeat '#')], map f pic, [take (w+2) (repeat '#')]]

  where
    f xs = '#' : (xs ++ ['#'])
