--AOJ Simple Print a Rectangle

import Control.Applicative

rInt :: String -> Int
rInt str = read str :: Int

strRectangle :: Int -> Int -> Char -> String
strRectangle h w c = (concat $ replicate h $ replicate w c ++ ['\n']) ++ "\n" 

main :: IO ()
main = do
  xs <- pure (map rInt . words) <*> getLine
  let h = head xs 
      w = last xs      
  if h == 0 && w == 0
    then return ()
    else do
    putStr $ strRectangle h w '#' 
    main