import           Control.Applicative
import           Data.Functor

main :: IO ()
main = do
  [h,w] <- fmap read . words <$> getLine
  if (h,w) == (0,0)
    then pure ()
    else printRect h w >> main

printRect :: Int -> Int -> IO ()
printRect h w = putStrLn rect
  where
    rect = unlines $ replicate h $ replicate w '#'

