#include <bits/stdc++.h>
using namespace std;
main() {
int times = 1, printftimes;
string output;
vector<string> outputs;
while(cin >> printftimes){
getchar();
if(printftimes == 0){
break;
}
for(int i = 0;i < printftimes;i++){
getline(cin,output);
outputs.push_back(output);
}
cout << "Case " << times++ << ":\n#include<string.h>\n#include<stdio.h>\nint main()\n{\n";
for(int i = 0;i < printftimes;i++){
cout << "printf(\"";
for(int j = 0;j < outputs[i].length();j++){
if(outputs[i][j] != '"' && outputs[i][j] != '\\'){
cout << outputs[i][j];
}
else if(outputs[i][j] == '"'){
cout << "\\\"";
}
else if(outputs[i][j] == '\\'){
cout << "\\\\";
}else{}
}
cout << "\\n\");\n";
}
cout << "printf(\"\\n\");\nreturn 0;\n}\n";
while(outputs.size()){
outputs.pop_back();
}
}
}