import Control.Applicative

main = do hws <- (map read) . (concatMap words) . lines <$> getContents
          putStr . unlines $ map unlines (solve hws)

solve :: [Int] -> [[String]]
solve (h:w:res) | h == 0 && w == 0 = []
                | otherwise = (replicate h . concat $ replicate w "#") : solve res