import Control.Monad

main :: IO ()
main = do
  [h, w] <- map (read :: String -> Int) . words <$> getLine
  strs <- replicateM h getLine
  let headder = replicate w '#'
  let ans = solve (headder : strs)
  mapM_ putStrLn ans
  putStrLn $ headder++"##"

solve :: [String] -> [String]
solve = map  (f. f)
  where
    f = (:) '#' . reverse
