#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000003;
using ll = long long;
using namespace std;

ll modPow(ll a, int n){
	ll res = 1;
	int i = 1;
	while( i <= n ) {
		if( n & i ){
			res *= a;
			res %= mod;
		}
		i <<= 1;
		a = a*a%mod;
	}
	return res;
}

ll mf[2000200];
ll dvf[2000200];

int main(){
	int q;
	scanf("%d\n", &q);
	mf[0] = 1; dvf[0] = 1;
	for( int k = 1; k <= 2000100; ++k ){
		mf[k] = (k*mf[k-1]) % mod;
		dvf[k] = (modPow(k, mod-2)*dvf[k-1]) % mod;
	}
	while( q-- ){
		ll x, d, n;
		scanf("%ld %ld %ld", &x, &d, &n);
		if( d == 0 ){
			printf("%d\n", modPow(x, n));
			continue;
		}
		if( n >= mod ){
			if( n >= mod ) printf("%d\n", 0);
			continue;
		}
		if( d != 1 ){
			x = (x*modPow(d, mod-2))%mod;
		}
		printf("%d\n", modPow(d, n) * ( mf[x+n-1]*dvf[x-1] % mod ) % mod );
	}
	return 0;
}