import Control.Monad

printLineN :: Int -> Char -> IO ()
printLineN n c = do
  replicateM n $ putChar c
  putChar '\n'

printRectangle :: Int -> Int -> IO ()
printRectangle h w = do
  replicateM h $ printLineN w '#'
  return ()

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