#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define maxn 500010
#define mod 1000003
ll po(ll x){
    ll bas=1,y=mod-2;
    while(y){
        if(y%2) bas=bas*x%mod;
        x=x*x%mod;
        y/=2;
    }
    return bas;
}
ll poo(ll x,ll y){
    ll bas=1;
    while(y){
        if(y%2) bas=bas*x%mod;
        x=x*x%mod;
        y/=2;
    }
    return bas;
}
ll ans[2000000];
int main(){
    int t;
    scanf("%d",&t);
    ans[0]=1;
    for(int i=1;i<=mod;i++){
        ans[i]=ans[i-1]*i%mod;
    }
    //cout<<po(ans[0]);
    while(t--){
        ll x,d,n;
        scanf("%lld%lld%lld",&x,&d,&n);
        if(d==0){
            printf("%lld\n",poo(x,n));
            continue;
        }
        ll y=x*po(d)%mod;
        //printf("%lld___\n",y);
        if(y+n-1>=mod||y==0){
            printf("0\n");
            continue;
        }
        d=poo(d,n);
        d*=ans[y+n-1];
        d%=mod;
        d*=po(ans[y-1]);
        d%=mod;
        printf("%lld\n",d);
    }
    return 0;
}