import Control.Monad
main=do
 [h,w]<-map read.words<$>getLine
 a<-replicateM h ((\x->'#':x++"#\n")<$>getLine)
 putStrLn((\x->x++"\n"++(concat a)++x)(f w))
  where f 0 = "##"
        f w = '#':(f (w-1))