import Text.Printf
main = do
  str<-getLine
  let [h,w]=map read $ words $ str::[Int]
  if(h==0 && w==0)
  then return ()
  else do
    putStrLn $ concat $ replicate h $ (replicate w '#')++"\n"
    main