module Main where

import Data.Functor
import Data.List

main :: IO ()
main =  putStr . unlines . unfoldr phi . zip [1..] =<< getCases

phi :: [(Int,String)] -> Maybe (String,[(Int,String)])
phi [] = Nothing
phi ((_,"0"):_) = Nothing
phi ((i,cs):rs) = Just ("Case "++show i++": "++cs,rs)

getCases :: IO [String]
getCases = words <$> getContents