import Control.Applicative
main = do
    ss <- words <$>getLine
    let a:b:_ = [read x| x<- ss] ::[Int]
    if a==0 && b==0 then return ()
    else do
      let o = concat[x++"\n" | x<-(take a (repeat(take b (repeat '#'))))]
      putStrLn $ o
      main