import Data.List

ints :: String -> [Int]
ints s = map read $ words s

getLines :: IO [[Int]]
getLines = do
  s <- getLine
  let [a, b] = ints s
  if a == 0 && b == 0
    then return []
    else do
      rest <- getLines
      return ([a, b] : rest)


calc :: Int -> Int -> String
calc w h = intercalate "\n" $ replicate h $ replicate w '#'

main :: IO ()
main = do
  xs <- getLines
  putStrLn $ intercalate "\n\n" $ [calc w h | ys <- xs, let [w, h] = ys]