-- 1_5_A
main =  do  cs <- getLine
            case cs of
                "0 0"   -> return ()
                cs      ->  do  putStrLn $ unlines $ make_a_rectangle $ map (\x -> read x::Int) $ words cs
                                main

make_a_rectangle :: [Int] -> [String]
make_a_rectangle xs = replicate (head xs) $ replicate (last xs) '#'