main = 
  let 
    func = do
      line <- getLine
      let 
        [h,w] = map read $ words line :: [Int]
        drawLine w = 
          if w > 0
            then do 
              putStr "#"
              drawLine (w-1)
            else do
              putStrLn ""
        drawRect h w =
          if h > 0
            then do
              drawLine w
              drawRect (h-1) w
            else do
              putStrLn ""
        in 
          if h == 0 && w == 0
            then putStr ""
            else do
              drawRect h w
              func
    in func

