main :: IO () main = interact $ f . scanl1 (-) . map read . tail . words f :: [Int] -> String f xs = if n == 0 then "T" else "F" where n = length $ filter (/= 1) $ map abs xs