import Data.List main = interact $ unlines . map (mapBool . odd . length . nub) . lines where mapBool b = if b then "1" else "0"