import Control.Monad
import Control.Applicative

solve :: [Int] -> String
solve [h,w] = 
    unlines . replicate h $ replicate w '#'

main =      
    mapM_ putStrLn =<< map solve . takeInputs . lines <$> getContents
    where
    takeInputs :: [String] -> [[Int]]
    takeInputs = takeWhile (all (/= 0)) . map (map read . words)