/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *NOIP 2019 RP++                                           *
 ***********************************************************/
//#pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
    char *pp = (char*)malloc(size) + size;  \
    __asm__("movl %0, %%esp\n" :: "r"(pp))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mn 200020
#define Max(x,y) ((x>y)?x:y)
#define Min(x,y) ((x<y)?x:y)
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (1<<30)
#define mod (1000003ll)
#define FOR(a,b,c) for (register int a=b;a<=c;++a)
#define FORD(a,b,c) for (register int a=b;a>=c;--a)
using namespace std;
//char buf[1<<20],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline ll read(){
    ll x=0,f=1;char c;
    for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
    for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());return x*f;
}
template<typename T>
inline void write(T a){
    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//
ll fr[mod+20],q,x,d,n,ans;
signed main(){
    #ifdef _WIN32
        freopen("0.in","r",stdin);
//        freopen("0.out","w",stdout);
//        ADD_STACK;
        long double be=clock();
    #endif
    q=read();
    fr[0]=1;
    FOR(i,1,mod)fr[i]=1ll*fr[i-1]*i%mod;
    while(q--){
    	x=read(),d=read(),n=read();
//    	#ifdef _WIN32
//    		ll ans2=1,xx=x;
//    		FOR(i,1,n)ans2=1ll*ans2*x%mod,x=(x%mod+d%mod)%mod;
//    		x=xx;
//    		write_(x,d,n);
//    		cout<<"Correct ans = ";writeln(ans2);
//    	#endif
    	if(d==0){
    		writeln(Pow(x,n));
    		continue;
    	}
    	ll YY=x*Pow(d,mod-2),XX=YY+n-1;
//    	writeln(YY,XX-YY/mod*mod);
    	if(YY%mod<=mod&&mod<=XX-YY/mod*mod){
    		writeln(0);continue;
    	}
//    	x=1ll*x%mod*Pow(d,mod-2)%mod;
    	ll X=1ll*(x+1ll*(n-1)%mod*d%mod)*Pow(d,mod-2)%mod,Y=(1ll*x*Pow(d,mod-2)%mod-1ll+mod)%mod;
//    	writeln(X,Y);
    	writeln(1ll*fr[X]*Pow(fr[Y],mod-2)%mod*Pow(d,n)%mod);
    }
    #ifdef _WIN32
        long double en=clock();
        printf("Time: %.0Lfms\n",en-be);
        fclose(stdin);fclose(stdout);
    #endif
    return 0;
}


Measured memory_bytes: 8832