getX = do
  x <- getLine
  if x == "0"
    then
      return []
    else do
      xs <- getX
      return (x:xs)

putX (x:xs) i = do
  if x == []
    then
      return []
    else do
      putStrLn $ "Case " ++ show(i) ++ ": " ++ x
      if xs == []
        then
          return []
        else do
          putX xs (i + 1)
          return []

main = do
  l <- getX
  putX l 1