import Data.List (intercalate)

drawLine :: Int -> IO ()
drawLine n = putStrLn $ intercalate "" $ replicate n "#"

draw :: Int -> Int -> IO ()
draw w h
  | w > 0     = drawLine h >> draw (w - 1) h
  | otherwise = putStrLn ""


main :: IO ()
main = do
    line <- getLine
    let [w, h] = map (\n -> read n :: Int) $ words line
    if w == 0 && h == 0 then
        return ()
    else do
        draw w h
        main
