loop ::	Int -> Int -> [String]
loop x y = if x	> 0 then replicate y '#' : loop	(x - 1) y else ["\n"]

solve :: [Int] -> [String]
solve (x : y : xs)
  | x == 0 && y == 0 = []
  | otherwise = loop x y ++ solve xs

main = getContents >>= mapM_ putStrLn . solve . map read . words