import Control.Applicative
import Data.Maybe

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

main = getContents >>=
       mapM_ (mapM_ putStr) . takeWhile (/= Nothing) . map (chessBorad 0 . map read . words) . lines