import Control.Monad(forM_)

main = do
  ns <- lines <$> getContents
  let is = map (\n -> read n::Int) $ words $ head ns
  let h = head is
  let w = last is
  let ls = tail ns
  let res = reverse $ solve h w ls [(replicate (w + 2) '#')]
  forM_ res putStrLn

solve :: Int -> Int -> [String] -> [String] -> [String]
solve h w ls acc
  | ls == [] = replicate (w + 2) '#' : acc
  | otherwise = solve (subtract 1 h) w (tail ls) (l : acc)
  where
    he = head ls
    l = "#" ++ he ++ "#"