import Control.Applicative
import Control.Monad
-- import Data.List
-- rInt s = read s :: Int

main = do
   ls <- zip [1..] .lines <$> getContents
   mapM putStrLn $ map (\(i,l) -> "Case " ++ (show i) ++ ": " ++ l) $ takeWhile (\(i,l) -> l /= "0") ls