import Data.Functor ((<$>))
import Control.Monad (replicateM_)

main :: IO ()
main = do
  [h, w] <- map (read :: String -> Int) . words <$> getLine
  if h == 0 && w == 0
    then return ()
    else printRect h w >> putChar '\n' >> main
    where printRect h w = replicateM_ h (putStrLn (replicate w '#'))

