main = 
    interact (calc . map (read) . words)

calc :: [Int] -> String
calc (0:0:_) = ""
calc (h:w:xs) = 
    row h w 0 ++ "\n" ++ calc xs

row :: Int -> Int -> Int -> String
row 0 _ _ = ""
row h w 0 = take w (concat $ replicate w "#.") ++ "\n" ++ row (h - 1) w 1
row h w _ = take w (concat $ replicate w ".#") ++ "\n" ++ row (h - 1) w 0

