import Control.Applicative
import Control.Monad

rect :: Int -> Int -> Char -> String
rect 0 _ _ = []
rect h w c = replicate w c ++ ['\n'] ++ rect (h - 1) w c

main = do 
  [h, w] <- map (\x -> read x :: Int) . words <$> getLine
  when (h /= 0 || w /= 0) $ putStr (rect h w '#') >> putChar '\n' >> main