main = readAndDo

readAndDo = do
  line <- getLine
  if line == "0 0" then return ()
  else do
    solve . input $ line
    putStrLn ""
    readAndDo

-- 入力
input :: String -> [Int]
input = (map read) . words

-- 解答
solve [0, b] = return ()
solve [a, b] = do
  putStrLn $ foldr (++) "" $ replicate b "#"
  solve [a-1, b]

