import Control.Monad
f x = do
  hw_in <- (return . words) =<< getLine
  let h:w:[] = map (read::String->Int) hw_in
  if (h==0) && (w==0)
    then return () else do
      forM_ [1..h] (\i->putStrLn ['#'|j<-[1..w]])
      putStrLn ""
      f (x+1)

main = f 0
