import Control.Monad
import Data.Char
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as UV

solve1 [h,w] = loop h
  where
    loop h = do
      if h == 0
        then putStrLn ""
        else do
        putStrLn $ concat $ replicate w "#"
        loop (h-1)

input1 :: IO [[Int]]
input1 = loop []
  where
    loop list = do
      temp <- getLine
      let [h,w] = map read . words $ temp :: [Int]
      if h == 0 && w == 0
        then return list
        else do
        loop (list ++ [[h,w]])

main = do
  hws <- input1
  mapM_ solve1 hws

