import Control.Applicative
import Control.Monad

solver :: Int -> Int -> [String]
solver h w = replicate h $ concat $ replicate w "#"


main :: IO()
main = do
  (h:w:_) <- map (read :: String -> Int) . words <$> getLine
  unless (h == 0 && w == 0) $ do
    mapM_ putStrLn $ solver h w
    putStrLn ""
    main