import Data.Functor( (<$>))

main = do
    ls <- (takeWhile ("0 0"/=)) . lines <$> getContents
    let
	hws = (read <$>) . words <$> ls
	printRect [h,w] = putStrLn `mapM_` rect >> putStrLn ""
	  where
	    hori = take w $ repeat '#'
	    rect = take h $ repeat hori

    printRect `mapM_` hws

