-- Structured Program I - Print a Chessboard

import Control.Applicative

main :: IO ()
main = do
  xs <- map words . takeWhile (/= "0 0") . lines <$> getContents
  mapM_ putStrLn $ map (chessbord . map read) xs

chessbord :: [Int] -> String
chessbord [h, w] = concat $ take h $ cycle [a, b]
  where
    a = (take w $ cycle "#.") ++ "\n"
    b = (take w $ cycle ".#") ++ "\n"

