i = 1

while True:

 a = input()

 if a == '0':

  break

 print("Case %d: %s" % (i,a))

 i = i + 1
i = 1

while True:

 a = input()

 if a == '0':

  break

 print("Case %d: %s" % (i,a))

 i += 1
i = 1
while True:
    a = input()
    if a == "0":
        break
    print("Case %d: %s" % (i, a))
    i = i + 1

i = 1
while True:
    a = input()
    if a == "0":
        break
    print("Case %d: %s" % (i, a))
    i += 1

-    i = i + 1 +    i += 1