main = getContents >>= putStr.formatOut.map calc.formatIn

formatIn :: String -> [[Int]]
formatIn = map ((map toInt).words).takeWhile (/="0 0").lines
  where toInt =read :: String -> Int

formatOut :: [String] -> String
formatOut = unlines

calc :: [Int] -> String
calc (h:w:_) = unlines $map ((take w).draw) [1..h] 
  where draw n | n `mod` 2 == 1 = cycle ['#','.']
               | otherwise      = cycle ['.','#']