tc = 0
while 1:
  if input() == '0':
    break
  tc +=1

for i in range(tc):
  print(f"Case {i+1}: Sorting... done!")
tc = 0
while 1:
  if input() == '0':
    break
  tc +=1

for i in range(tc):
  print(f"Case {i+1}: Sorting... done!")