import Control.Monad
import Control.Applicative

solve :: Int -> Int -> String
solve n x =
    "Case " ++ show n ++ ": " ++ show x

main =
    mapM_ putStrLn =<< (zipWith solve [1..]) . takeInputs . lines <$> getContents
    where
    takeInputs :: [String] -> [Int]
    takeInputs = takeWhile (/= 0) . map read 
