drawRect :: Int -> Int -> IO ()
drawRect 0 w = putStrLn ""
drawRect h w = do
  putStrLn . take w . repeat $ '#'
  drawRect (h-1) w

main = do
  l <- getLine
  let (h:w:_) = map read . words $ l
  if h == 0 && w == 0 then return ()
  else drawRect h w >> main