//KZNS
#include <fstream>
using namespace std;
//
ifstream fin ("Cheerleaders.in");
ofstream fout ("Cheerleaders.out");
//
#define MD 1000007
int C[503][503] = {0};
//
int main() {
for (int i = 1; i <= 400; i++) {
C[i][1] = i;
C[i][0] = 1;
for (int j = 2; j <= i; j++)
C[i][j] = (C[i-1][j] + C[i-1][j-1]) % MD;
}
int T;
fin >> T;
int n, m, k;
for (int i = 1; i <= T; i++) {
fin >> n >> m >> k;
int a, b, c;
int ans = 0;
for (int t = 0; t < 16; t++) {
a = n;
b = m;
c = 0;
if (t&1) {
a--;
c++;
}
if (t&2) {
a--;
c++;
}
if (t&4) {
b--;
c++;
}
if (t&8) {
b--;
c++;
}
if (c&1) {
ans = (ans + MD -C[a*b][k]) % MD;
}
else {
ans = (ans + C[a*b][k]) % MD;
}
}
fout << "Case " << i << ": " << ans << endl;
}
return 0;
}
//UBWH