printMark row col = if( mod (row + col) 2 == 0) then "#" else "."

printChess :: [Int] -> IO()
printChess [h,w] = printChess [h,w,0,0]
printChess [h,w,row,col]
    | row == h && col == w = do
        putStrLn $ printMark row col
        putStr "\n"
    | col == w = do
        putStr $ printMark row col
        putStr "\n"
        printChess [h,w,row + 1,0]
    | otherwise = do
        putStr $ printMark row col
        printChess [h,w,row,col + 1]

main = getContents >>= mapM_ printChess . map (map read) . (map words) .  lines
