import Control.Applicative

import Control.Monad
    (when)

type Problem = (Int, Int)

type Result = [String]

solve :: Problem -> Result

solve (h, w)
    = [['#' | _ <- [1..w]] | _ <- [1..h]]

input :: IO Problem

input
    = do
        [h, w] <- map read.words <$> getLine
        return (h, w)

output :: Result -> IO ()

output xs
    = putStrLn $ concat [x ++ "\n" | x <- xs]
    
main :: IO ()

main
    = do
        xs <- input
        when (xs /= (0, 0)) $ do
            output $ solve xs
            main