main = mapM_ process . takeWhile (/= "0 0") . lines =<< getContents
  where process line = do
                          putStrLn $ unlines (replicate h (replicate w '#'))
                          where [h,w] = map (read::String->Int) $ words line