import Control.Applicative
import Control.Monad

rect :: Int -> Int -> String
rect h w = unlines $ replicate h (replicate w '#')

main :: IO ()
main = do
    xss <- fmap (fmap read . words) . lines <$> getContents :: IO [[Int]]
    forM_ (takeWhile (/= [0, 0]) xss) $ \[h, w] -> do
        putStrLn $ rect h w

