import Control.Monad

solve :: [Int] -> IO ()
solve [h, w] = do
    replicateM_ h (putStrLn $ replicate w '#')
    putStrLn ""

main :: IO ()
main = getContents >>= mapM_ solve . takeWhile (\[h, w] -> h /= 0 || w /= 0) . map (map read . words) . lines