wrapper::Int->Int->[[Char]]->[[Char]]
wrapper x y pic = let sharps = take (y+2) (repeat '#') in
                  sharps:( (map (\z -> '#':(z++"#")) pic)++[sharps])

get_n::Int->IO [[Char]]
get_n 0 =return []
get_n n = do
  this<-getLine
  rest<-get_n (n-1)
  return (this:rest)

out_pic::[[Char]]->IO()
out_pic [] = return()
out_pic (x:xs) = do
    putStr x
    putStr "\n"
    out_pic xs

main::IO()
main=do
  hwc<-getLine
  let h:w:[] = map read (words hwc)
  pic<-get_n h
  out_pic (wrapper h w pic)
