import Control.Monad
import Text.Printf
drawRect :: Int -> Int -> IO ()
drawRect h w = replicateM_ h (putStrLn $ replicate w '#') >> putStrLn ""
loop = do
    ln <- getLine
    let [h,w] = map read $ words ln :: [Int]
    if h == 0 && w == 0 then
        return ()
    else do
        drawRect h w
        loop

main = loop