drawRect :: Int -> Int -> IO ()
drawRect 0 w = do
               putStrLn ""
               return ()
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 do
    drawRect h w
    main