(小脑萎缩)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,c,ansed[21][21][21];
ll w(ll a,ll b,ll c) {
if(a<=0||b<=0||c<=0) return 1;//情况一
if(a>20) a=20;
if(b>20) b=20;
if(c>20) c=20;
if(ansed[a][b][c]!=0) {
return ansed[a][b][c];
}
if(a==20&&b==20&&c==20) { //情况二
ll tmp=w(20,20,20);
ansed[20][20][20]=tmp;
return tmp;
}
if(a<b&&b<c) { //情况3
ll tmp=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c);
ansed[a][b][c]=tmp;
return tmp;
}
ll tmp=w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);
ansed[a][b][c]=tmp;
return tmp;
}
int main() {
cin>>a>>b>>c;
while(a!=-1&&b!=-1&&c!=-1) {
ll ans=w(a,b,c);
printf("w(%lld, %lld, %lld) = %lld\n",a,b,c,ans);
cin>>a>>b>>c;
}
return 0;
}