makeSquare :: [Int] -> String
makeSquare [h,w] = unlines $ replicate h ws
  where
    ws = foldr1 (++) $ replicate w "#"

main :: IO ()
main = do
  s' <- getLine
  let s = (map read . words) s'

  if s == [0,0] then return ()
  else do
    putStrLn $ makeSquare s
    main