import Control.Applicative
import Text.Printf

main :: IO ()
main = do
  xs <- (map read . words) <$> getLine
  if xs !! 0 == 0 && xs !! 1 == 0 then return ()
    else do {
    putStrLn $ solve xs;
    main
    }

solve :: [Int] -> String
solve xs
  | h == 0 = ""
  | otherwise = (replicate w '#') ++ "\n" ++ solve ((h-1) : w : [])
  where h = xs !! 0
        w = xs !! 1