import Data.Set (Set, toList, fromList, findMax, foldl', delete)
main = do
    str <- getLine
    let [h, w] = map read $ words $ str :: [Int]
    if h == 0 && w == 0
        then return ()
        else do
            putStr . unlines $ replicate h  $ replicate w '#'
            putStr "\n"
            main