import Data.List
import Data.List.Split
import Data.Char (isSpace)

trim :: String -> String
trim = f . f
  where
    f = reverse . dropWhile isSpace

calc :: Int -> String -> String
calc index s = "Case " ++ show index ++ ": " ++ s

main = do
  s <- getContents
  let xs = splitOn "\n" $ trim s
  putStrLn $ intercalate "\n" [calc i s | (i, s) <- zip [1..] xs, s /= "0"]