import Control.Monad
import Control.Applicative
readDigits = map read <$> words <$> getLine :: IO [Int]
main =
    loop
    where
    loop = do
        [h,w] <- readDigits
        unless (h == 0 && w == 0) $ do
            putStrLn . unlines . replicate h $ replicate w '#'
            loop