#include<iostream>
using namespace std;
long mod=1e6+3;
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
long fac[1<<20],inv[1<<20];
int main()
{
	fac[0]=1;
	for(long i=1;i<mod;i++)fac[i]=fac[i-1]*i%mod;
	inv[mod-1]=power(fac[mod-1],mod-2);
	for(long i=mod-1;i--;)inv[i]=inv[i+1]*(i+1)%mod;
	long Q;cin>>Q;
	for(;Q--;)
	{
		long x,d,n;cin>>x>>d>>n;
		if(d==0)
		{
			cout<<power(x,n)%mod<<endl;
			continue;
		}
		long div=x*power(d,mod-2)%mod;
		if(n+div-1>=mod)cout<<0<<endl;
		else cout<<power(d,n)*fac[(n+div-1+mod)%mod]%mod*inv[(div-1+mod)%mod]%mod<<endl;
	}
}