#include<bits/stdc++.h>

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const int P=1E6+3;

ll fac[P],ifac[P];

ll ksm(ll a,ll b)
{
	ll ret=1;
	for(;b;b>>=1,(a*=a)%=P)
		if(b&1)
			(ret*=a)%=P;
	return ret;
}

void solve()
{
	int x,d,n;
	scanf("%d%d%d",&x,&d,&n);
	if(d==0)
		return printf("%lld\n",ksm(x,n)),void();
	if(n>=P||x==0)
		return puts("0"),void();
	int b=1ll*x*ksm(d,P-2)%P;
	if(b+n-1>=P)
		return puts("0"),void();
	printf("%lld\n",fac[b+n-1]*ifac[b-1]%P*ksm(d,n)%P);
}

int main()
{
	fac[0]=ifac[0]=1;
	for(int i=1;i<P;i++)
		fac[i]=fac[i-1]*i%P;
	ifac[P-1]=ksm(fac[P-1],P-2);
	for(int i=P-2;i;i--)
		ifac[i]=ifac[i+1]*(i+1)%P;
	int T;
	for(scanf("%d",&T);T--;solve());
}
