import Control.Applicative
import Control.Monad
main = solve

solve = do
    ns <- fmap (read :: String -> Int) . words <$> getLine
    let h = ns !! 0
        w = ns !! 1
    drawRectangle h w

drawRectangle :: Int -> Int -> IO ()
drawRectangle h w
    | h == 0 && w == 0 = return ()
    | otherwise = do
        mapM_ (\_ -> putStrLn $ replicate w '#') [1..h]
        putStrLn ""
        solve