solve :: Int -> [String] -> [String]
solve n (x:xs)
  | x == "0" = []
  | otherwise = ("Case " ++ show n ++ ": " ++ x) : solve (n + 1) xs

main = getContents >>= mapM_ putStrLn . (solve 1) . (++["a"]) . words