module Main where
import Debug.Trace
import Data.List
import Data.Maybe
import Data.Ord
import Control.Monad

solve :: [[Int]] -> [String]
solve [] = []
solve ([h,w]:xs) = (replicate h $ replicate w '#') ++ ["\n"] ++ solve xs


readLine:: IO [Int]
readLine = fmap (map read . words) getLine

readUntil :: ([Int] -> Bool) -> IO [[Int]]
readUntil eof = iter where
    iter = readLine >>=
            (\a -> if eof a then return [] else fmap (a:) iter)

eof :: [Int] -> Bool
eof (x0:x1:xs) = [x0, x1] == [0, 0]

main :: IO() 
main = do
    l <- readUntil eof
    mapM_  putStrLn (solve l)
    
