main = 
    interact (calc . map (read) . words)

calc :: [Int] -> String
calc (0:0:_) = ""
calc (h:w:xs) = 
    ln h w ++ "\n" ++ calc xs

ln :: Int -> Int -> String
ln 0 _ = ""
ln h w = 
    (replicate w '#') ++ "\n" ++ (ln (h-1) w)
