include
using namespace std;
int main(){
int a,b,c;
int count=1;
while(cin>>a>>b>>c){
for(int i=10;i<=100;i++){
if(i%3==a&&i%5==b&&i%7==c){
cout<<"Case "<<count++<<": "<<i<<endl;
break;
}
if(i==100)cout<<"Case "<<count++<<": No answer"<<endl;
}
}
return 0;
}