loop :: Int -> Int -> Int -> [String]
loop x' x y = if x > 0 then (take y $ drop (x'-x) $ concat $ replicate 1000 "#.") : loop x' (x - 1) y else [""]

solve :: [Int] -> [String]
solve (x : y : xs)
  | x == 0 && y == 0 = []
  | otherwise = loop x x y ++ solve xs

main = getContents >>= mapM_ putStrLn . solve . map read . words