main = getContents >>= putStrLn.unlines.cnt.lines

cnt :: [String] -> [String]
cnt xs = takeWhile (/="") $zipWith cntCase (take (length xs) $map show [1,2..] ) xs

cntCase :: String -> String -> String
cntCase _ "0" = ""
cntCase i x =  "Case "++i++": "++x 