{-
ITP1_5-A
Structured Program I - Print a Rectangle
Time Limit : 1 sec, Memory Limit : 65536 KB
????????¢?????????

??????H cm ?????? W cm ???????????¢?????????????????°?????????????????????????????????

1 cm ?? 1cm ???????????¢??? '#'??§??¨????????????
Input

??\???????????°????????????????????????????§???????????????????????????????????????????????????¢????????\????????¨????????§??????

H W

H, W ?????¨?????? 0 ?????¨????????\?????????????????¨????????????
Output

????????????????????????????????????H ?? W ?????? '#' ??§????????????????????¢???????????????????????????

?????????????????????????????????????????????????????\??????????????????
Constraints

H, W ??? 300
Sample Input

3 4
5 6
2 2
0 0

Sample Output

####
####
####

######
######
######
######
######

##
##

-}
import Data.List.Split
import Text.Printf

main = do
  s <- getLine
  let [h,w] = map (\x-> read x::Int) $ splitOn " " s
  if h==0 && w==0 then return()
    else do
      mapM_ (\x->putStrLn $ aux w) [1..h]
      printf "\n"
      main

aux :: Int -> String
aux w = foldr (\x acc-> "#" ++ acc) "" [1..w]