module Main where type Input = [Int] type Output = [Int] parse :: String -> Input parse = map read . tail . lines solve :: Input -> Output solve input = let f 1 = 1 f _ = 0 in map f input render :: Output -> String render = unlines . map show main :: IO () main = interact ( render . solve . parse )