import Control.Applicative
import Control.Monad

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

addReturn :: String -> String
addReturn x = x ++ "\n"

shapingData :: String -> [[Int]]
shapingData = map (map read . words) . takeWhile ( /= "0 0") . lines
main = do
    line <- getContents
    let shapedData = shapingData line 
    putStr $ shapedData >>= addReturn . makeLine 
