main :: IO ()
main = do
    line <- getLine
    case (words line) of
      ["0", "0"] -> return ()
      [h, w] -> do
          mapM_ putStrLn $ replicate (read h :: Int) $ replicate (read w :: Int) '#'
          putStrLn ""
          main