chessBorad :: Int -> [Int] -> String
chessBorad i l@(h:w:_) | h == 0 && w == 0 = "end"
                       | i /= h && even i = (take w . concat . repeat $ "#.") ++ "\n" ++ chessBorad (i+1) l
                       | i /= h && odd i  = (take w . concat . repeat $ ".#") ++ "\n" ++ chessBorad (i+1) l
                       | otherwise = "\n"

main = getContents >>=
       \content -> return (map (chessBorad 0) . map (map read) . map words . lines $ content)  >>=
       \l -> do
             if or . map (\res -> res == "end") $ l then return ()
             else putStrLn . concat $ l