#include <iostream>
#define ll long long
using namespace std;

ll mod=1000003;
const int arm=1000050;
ll fac[arm], finv[arm], inv[arm];
void COMinit(ll m){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for (int i=2; i<arm; ++i){
        fac[i]=(fac[i-1]*i)%m;
        inv[i]=m-(inv[m%i]*(m/i))%m;
        finv[i]=(finv[i-1]*inv[i])%m;
    }
}

ll modpow(ll a, ll b, ll m){
    ll res=1, p=0, now=a;
    b %= (m-1);
    for(int i=0; b>p; ++i){
        if(b&((ll) 1<<i)){
            res=(res*now)%m;
            p |= ((ll) 1<<i);
        }
        now=(now*now)%mod;
    }
    return res;
}
ll modinv(ll a, ll m){
    return modpow(a, m-2, m);
}
ll moddiv(ll a, ll b, ll m){
    return (a*modinv(b, m))%m;
}

ll solve(ll X, ll D, ll N){
    if(D==0) return modpow(X, N, mod);
    if(X==0) return 0;
    ll t=moddiv(X, D, mod), u=modpow(D, N, mod);
    if(t+N>mod) return 0;
    ll v=(fac[t+N-1]*finv[t-1])%mod;
    return (v*u)%mod;
}

int main() {
	int Q;
	cin >> Q;
	COMinit(mod);
	for(int i=0; i<Q; ++i){
	    ll x, d, n;
	    cin >> x >> d >> n;
	    cout << solve(x, d, n) << endl;
	}
	return 0;
}
