import Control.Monad (replicateM) import Data.Bool main = replicateM 3 getLine >>= putStrLn . rb . foldr f 0 where f s y = bool 0 1 (s == "RED") + y rb = bool "BLUE" "RED" . (> 0)