#include<bits/stdc++.h>
using namespace std;
const int mod=1000003;
inline int ksm(int a,int b)
{
	int res=1;
	for(;b;b>>=1,a=1ll*a*a%mod) if(b&1) res=1ll*res*a%mod;
	return res;
}
int mulv[mod+100];
int main()
{
	for(int i=mulv[0]=1;i<mod;i++) mulv[i]=1ll*mulv[i-1]*i%mod;
	int T;cin>>T;
	while(T--)
	{
		int x,d,n;scanf("%d%d%d",&x,&d,&n);
		int k=1ll*x*ksm(d,mod-2)%mod;
		if(d==0){printf("%d\n",ksm(x,n));continue;}
		if(k+n-1>=mod||k==0) {puts("0");continue;}
		printf("%lld\n",1ll*ksm(d,n)*mulv[k+n-1]%mod*ksm(mulv[k-1],mod-2)%mod);
	}
}