#include<cstdio>

struct modular_arithmetic{
	int mod;

	modular_arithmetic(){
		mod = 1000003;
	}
	//No specific settings.
	int add(int x,int y){return (x+=y)<mod?x:x-mod;}
	int sub(int x,int y){return (x-=y)>=0?x:x+mod;}
	int mul(int x,int y){return (int)((long long int)x*y%mod);}
	int pw(int base, int p) {
		int res = 1, mu = base%mod;
		for(;p>0;p/=2) {
			if (p&1) res = mul(res, mu);
			mu = mul(mu, mu);
		}
		return res;
	}
	int rev(int x) {return pw(x, mod-2);}
};
modular_arithmetic ma;

int v[1001001];

int main() {
	v[0] = v[1] = 1;
	for(int i=2;i<ma.mod;i++)
		v[i] = ma.mul(v[i-1], i);
	
	int T;
	for(scanf("%d", &T);T--;) {
		int x, d, n;
		scanf("%d%d%d", &x, &d, &n);
		x%=ma.mod;
		d%=ma.mod;
		if(d==0) {
			printf("%d\n", ma.pw(x, n));
			continue;
		}
		
		int xd = ma.mul(x, ma.rev(d));
		if (xd+n-1>=ma.mod) {
			puts("0");
			continue;
		}
		
		int ans = ma.pw(d, n);
		int l = xd, r = xd+n-1;
		ans = ma.mul(ans, v[r]);
		if(l>1) ans = ma.mul(ans, ma.rev(v[l-1]));
		printf("%d\n", ans);
	}
	
	return 0;
}