rect (h:w:_) = [if even y then tail xs else init xs | y <- [0..h-1]]
    where xs = [if even x then '.' else '#'| x <- [0..w]]

main=do
    line <- fmap (map (map read . words) . lines) getContents
    mapM_ putStrLn . map (unlines . rect) $ takeWhile (\(x:xs)->x/=0) line
