import Control.Monad
import Data.Function

solve2 list = map addStr list
  where
    addStr (i,x) = "Case " ++ (show i) ++ ": " ++ show x

input = loop 0 []
  where
    loop :: Int -> [Int] -> IO [Int]
    loop x list = do
      x' <- readLn
      if x' == 0
        then return list
        else do
        loop x' (list ++ [x'])

main = do
  list <- input
  let list' = zip [1..] list
  mapM_ putStrLn $ solve2 list'
