main = do
  [h,w] <- map read . words <$> getLine
  let pp = take (w + 2) $ repeat '#'
  putStrLn pp
  solve h
  putStrLn pp

solve :: Int -> IO()
solve 0 = return ()
solve x = do
  ('#' :) . (++ "#") <$> getLine >>= putStrLn
  solve $ x - 1
