int temp[21][21][21];
void calculate()
{
for (int i = 0; i < 21; i ++)
for (int j = 0; j < 21; j ++)
for (int k = 0; k < 21; k ++)
{
if (i == 0 || j == 0 || k == 0)
temp[i][j][k] = 1;
else if (i < j && j < k)
temp[i][j][k] = temp[i][j][k - 1] + temp[i][j - 1][k - 1] - temp[i][j - 1][k];
else
temp[i][j][k] = temp[i - 1][j][k] + temp[i - 1][j - 1][k] + temp[i - 1][j][k - 1] - temp[i - 1][j - 1][k - 1];
}
}
int w(int a, int b, int c)
{
if (a <= 0 || b <= 0 || c <= 0)
return 1;
else if (a > 20 || b > 20 || c > 20)
return temp[20][20][20];
else
return temp[a][b][c];
/*if (a <= 0 || b <= 0 || c <=0)
return 1;
else if (a > 20 || b > 20 || c > 20)
return w(20 ,20 ,20);
else if (a < b && b < c)
return w(a, b, c-1) + w(a, b-1, c-1) - w(a, b-1, c) ;
else
return w(a-1, b, c) + w(a-1, b-1, c) + w(a-1, b, c-1) - w(a-1, b-1, c-1); */
}
int main(int argc, char* argv[])
{
calculate();
vector<int*> input;
int *triple = new int[3];
cin >> triple[0] >> triple[1] >> triple[2];
const int MAX_LENGTH = 100;
char buf[MAX_LENGTH];
while(triple[0] != -1 || triple[1] != -1 || triple[2] != -1)
{
input.push_back(triple);
triple = new int[3];
cin >> triple[0] >> triple[1] >> triple[2];
}
for (vector<int*>::iterator iter = input.begin(); iter != input.end(); iter ++)
{
memset(buf, 0, MAX_LENGTH);
sprintf(buf, "w(%d, %d, %d) = %d", (*iter)[0], (*iter)[1], (*iter)[2], w((*iter)[0], (*iter)[1], (*iter)[2]));
cout << buf << endl;
if (*iter)
delete [](*iter);
}
if (triple)
{
delete []triple;
triple = NULL;
}
return 0;
}