main :: IO ()
main = do ls <- getContents
          putStr (compose ls)

compose :: String -> String
compose = unlines . fmap unlines . rect . fmap (toTupleofInts . take 2 . words) . lines
          where
            toTupleofInts =  (\[x,y] -> (x,y)) . fmap (\x -> read x::Int)

rect :: [(Int, Int)] -> [[String]]
rect [] = []
rect ((m, n):xs) | m == 0 && n == 0 = []
                 | otherwise = replicate m (replicate n '#') : rect xs