printNum::Int->IO()
printNum n = putStrLn $ take n $ repeat '#'


printRec::(Int,Int)->IO ()
printRec (a,b) = sequence_ $ take a $ repeat $ printNum b

main = getContents >>= mapM_ printRec $ takeWhile(/=(0,0))$map (\[x,y]->(read x::Int,read y::Int)) $ map words $ lines