import Control.Applicative
main = do
  [h, w] <- map (read :: String -> Int) . words <$> getLine
  if h == 0 && w == 0
    then return [()]
    else do
      sequence . map putStrLn . replicate h $ replicate w '#'
      putStrLn ""
      main