main :: IO()
main = do
  inputs <- getContents
  let specs = [ map (\x ->read x ::Int) $ words line | line <- lines inputs, length(line) > 0]
  mapM_ drawRect specs

drawRect :: [Int] -> IO()
drawRect [h,w]
         | (h,w) == (0,0) = return()
         | otherwise = do putStrLn $ concat $ replicate h $ concat $ (replicate w "#") ++ ["\n"]