x = gets.to_i
l = 0
d = [][2]
while x != 0
  d = [l+1,x]
  puts "Case" + " " + d[0].to_s + ":" + " " + d[1].to_s

  unless (d.count <= 10000) || (1 <= x || x <= 10000  )
    return
  end

  l += 1
  x = gets.to_i
end
