import scala.collection.JavaConverters._

object Main extends App {
  val scanner = new java.util.Scanner(System.in).asScala

  val data = scanner.map(_.toInt).takeWhile(_ != 0).zipWithIndex.toList
  data.foreach {
    case (x, i) =>
      println(s"Case ${i+1}: ${x}")
  }
}