import Data.List(intercalate)

main :: IO ()
main = interact $ unlines . map (box . strToIntList) . takeWhile (/="0 0") . lines

strToIntList :: String -> [Int]
strToIntList = map read . words

box :: [Int] -> String
box [h, w] = (intercalate "\n" . replicate h . replicate w $ '#') ++ "\n"