import Control.Applicative

main = do 
	[h, w] <- toIntList <$> getLine
	if h == 0 && w == 0
	then return ()
	else do 
		mapM_ putStrLn $ showAnswer h w
		putStrLn ""
		main

toIntList :: String -> [Int]
toIntList = map read . words

showAnswer :: Int -> Int -> [String]
showAnswer h w = replicate h $ replicate w '#'
