#include<bits/stdc++.h>
using namespace std;
long long a,b,c,remember[23][23][23];
bool vis[23][23][23];
long long fun(long long a,long long b,long long c){
if(a<=0||b<=0||c<=0) return 1;
else if(vis[a][b][c]) return remember[a][b][c];
vis[a][b][c]=true;
if(a>20||b>20||c>20) return remember[20][20][20]=fun(20,20,20);
if(a<b&&b<c)
if(remember[a][b][c]==-1) return remember[a][b][c]=fun(a,b,c-1)+fun(a,b-1,c-1)-fun(a,b-1,c);
else {
if(remember[a][b][c]==-1)
remember[a][b][c]=fun(a-1,b,c)+fun(a-1,b-1,c)+fun(a-1,b,c-1)-fun(a-1,b-1,c-1);
}
return remember[a][b][c];
}
int main(){
while(1){
cin>>a>>b>>c;
if(a==-1&&b==-1&&c==-1) break;
memset(remember,-1,sizeof(remember));
printf("w(%lld, %lld, %lld) = %lld\n",a,b,c,fun(a,b,c));
}
return 0;
}
```