import Data.Foldable (traverse_)
import Data.Functor ((<$>))

main = do
  xs <- takeWhile (\[x, y] -> [x, y] /= [0, 0]) . map (map read . words) . lines <$> getContents
  traverse_ printBox xs
  where
  printBox [x, y] = putStrLn $ unlines $ replicate x (replicate y '#')

