printRectangle :: Int -> Int -> IO ()
printRectangle h w = mapM_ putStrLn $ take h $ repeat $ take w $ repeat '#'

main :: IO ()
main = do
  input <- getLine
  let [h, w] = map read $ words input
  if h == 0 && w == 0
    then do return ()
    else do
    printRectangle h w
    putChar '\n'
    main