lis = []

a = int(input())

while a != 0:

 lis.append(a)

 a = int(input())



for i,v in enumerate(lis):

 print("Case %d: %d" % (i+1,v))
lis = []

a = input()

while a != '0':

 lis.append(a)

 a = input()



for i,v in enumerate(lis):

 print("Case %d: %s" % (i+1,v))
lis = []
a = int(input())
while a != 0:
    lis.append(a)
    a = int(input())
for i, v in enumerate(lis):
    print("Case %d: %d" % (i + 1, v))

lis = []
a = input()
while a != "0":
    lis.append(a)
    a = input()
for i, v in enumerate(lis):
    print("Case %d: %s" % (i + 1, v))

-a = int(input()) -while a != 0: +a = input() +while a != "0": -    a = int(input()) +    a = input() -    print("Case %d: %d" % (i + 1, v)) +    print("Case %d: %s" % (i + 1, v))