i=1

while True:

 n=eval(input())

 if int(n)==0:break

 print(f'Case {i}: {n}')

 i+=1
a=[]

b=a.append

while True:

 n=eval(input())

 if int(n)==0:break

 b(n)

for i in range(len(a)):print(f'Case {i+1}: {a[i]}')
i = 1
while True:
    n = eval(input())
    if int(n) == 0:
        break
    print(f"Case {i}: {n}")
    i += 1

a = []
b = a.append
while True:
    n = eval(input())
    if int(n) == 0:
        break
    b(n)
for i in range(len(a)):
    print(f"Case {i+1}: {a[i]}")

-i = 1 +a = [] +b = a.append -    print(f"Case {i}: {n}") -    i += 1 +    b(n) +for i in range(len(a)): +    print(f"Case {i+1}: {a[i]}")