import Data.List.Split

main :: IO ()
main = interact $ unlines . map (convert . map read . words) . init . lines

convert :: [Int] -> String
convert [h,w] = unlines $ chunksOf w $ replicate (h*w) '#'
