main = do
    ss <- getLine
    let hw = map (\x -> read x :: Int) $ words ss
    let h = hw!!0
    let w = hw!!1
    if (h == 0 && w ==0)
        then return ()
        else do
            drawSquare h w
            main

drawSquare h w = do
    let l = replicate w '#'
    draw l h
    
draw l n = if (n<=0)
              then putStrLn ""
              else do
                  putStrLn l
                  draw l (n-1)
