import Control.Monad
main = do
  [h, w] <- fmap (map read . words) getLine :: IO [Int]
  if [h, w] == [0, 0] then
    return ()
  else do
    replicateM h $ (replicateM w (putStr "#") >> putStrLn "")
    putStrLn ""
    main