// #includes {{{
#ifdef MY_DEBUG
#include "header/header.hpp"
#else
#include <bits/stdc++.h>
#endif

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

template<class T>
T inf(){
	return numeric_limits<T>::has_infinity?numeric_limits<T>::infinity():(numeric_limits<T>::max()/2);
}

typedef pair<int,int> pii;

#ifdef MY_DEBUG
#include"print.hpp"
#include"debug.hpp"
#endif
// }}}

//{{{ gcd and inverse
#define __GCD_H
Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a / gcd(a, b) *b;
}
// a x + b y = gcd(a, b)
Int extgcd(Int a, Int b, Int &x, Int &y) {
	Int g = a; x = 1; y = 0;
	if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
	return g;
}
Int invMod(Int a, Int m) {
	Int x, y;
	if (extgcd(a, m, x, y) == 1) return (x + m) % m;
	else                         return 0; // unsolvable
}
//}}}

const long long MOD = 1000003;
//{{{ modular algebra
template<int mod=MOD>
struct Num{
	int v;
	Num(int n):v(n){}
	Num(long long n){
		v = n;
		if(0<=v and v<mod)return;
		v%=mod;
		if(v<0)v+=mod;
	}
	Num():v(0){}
	operator int() const {return v;}
	operator long long() const {return v;}
	template<class T>
	Num operator =(int n){v=n;return *this;}

	template<class T>
	inline void operator *=(const T &a) {
		v = (v*(long long)a)%mod;
	}
	template<class T>
	inline Num operator *(const T &a) {
		Num n(*this);n*=a;
		return n;
	}
	template<class T>
	inline void operator+=(const T &a){
		v+=(int)a;
		if(v>=mod)v-=mod;
		//	assert(0<=v and v<mod);
	}
	template<class T>
	inline Num operator+(const T &a){
		Num n(*this);n+=a;
		return n;
	}
	inline Num operator -(){
		if(v==0)return 0;
		else return Num(mod-v);
	}
	template<class T>
	inline void operator -=(const T &a){
		v-=(int)a;
		if(v<0)v+=mod;
	}
	template<class T>
	inline Num operator -(const T &a){
		Num n(*this);n-=a;
		return n;
	}
#ifdef __GCD_H
	inline Num inv(){
		return Num(invMod(this->v,mod));
	}
	template<class T>
	inline void operator /=(const T &a){
		(*this)*=invMod((int)a,mod);
	}
	template<class T>
	inline Num operator /(const T &a){
		Num n(*this);n/=a;
		return n;
	}
#endif
};

template<class T, int mod>
T& operator <<(T &os, const Num<mod> &n){
	os<<(int)n.v;
	return os;
}

template<class T, int mod>
T& operator >>(T &is, Num<mod> &n){
	is>>n.v;
	return is;
}
//}}}
using mod_int =  Num<MOD>;

//{{{ fact, binom, multinom
template<int mod=MOD>
inline Num<mod> fact(int n){
	static vector<Num<mod>> __fact(1,1);
	while(n>=(int)__fact.size())__fact.push_back(__fact.back()*__fact.size());
	return __fact[n];
}

template<int mod=MOD>
inline Num<mod> binom_memo(int n,int r){
	static vector<vector<Num<mod> > > __binom;
	if(n<0 or r<0 or n<r)return 0;
	while(n>=(int)__binom.size())__binom.push_back(vector<Num<mod> >(__binom.size()+1,-1));
	if((int)__binom[n][r]!=-1)return __binom[n][r];
	else if(r==0 or n==r)return __binom[n][r].v = 1;
	else return __binom[n][r] = binom_memo(n-1,r-1) + binom_memo(n-1,r);
}

#ifdef __GCD_H
template<int mod=MOD>
inline Num<mod> binom(int n,int r){
	if(n<0 or r<0 or n<r)return 0;
	Num<mod> fn = fact<mod>(n), fr = fact<mod>(r), fr2 = fact<mod>(n-r);
	//	return fact(n)/(fact(r)*fact(n-r));
	return fn/(fr*fr2);
}

template<int mod=MOD>
inline Num<mod> multinom(const vector<int> &v){
	Num<mod> num(fact<mod>(accumulate(ALL(v),0))), denom(1);
	REP(i,v.size())denom*=fact<mod>(v[i]);
	return num/denom;
}
#endif
//}}}

//{{{ mod_pow(Num<mod> x,Int k)
/* (x^k)%m */
template<int mod=MOD>
inline Num<mod> mod_pow(Num<mod> x, Int k){
	if(k==0) return 1;
	Num<mod> res(mod_pow(x,k/2));
	res*=res;
	if(k%2)res*=x;
	return res;
}
template<int mod=MOD>
inline Num<mod> mod_pow2(const Num<mod> &x, Int k){
	if(k==0) return 1;
	Num<mod> res(mod_pow2(x,k/2));
	res*=res;
	if(k%2)res*=x;
	return res;
}

template<class T, int mod=MOD>
inline Num<mod> mod_pow(T x, Int k){
	return mod_pow(Num<mod>(x),k);
}


//}}}

Int Q;
vector<Int> x;
vector<Int> d;
vector<Int> n;

void solve(){
	REP(q,Q){
		if(d[q]==0){
			cout<<mod_pow(x[q],n[q])<<endl;
		}else{
			int t = int(mod_int(x[q])/d[q]);
			if(t + n[q] - 1 >= MOD){
				cout<<0<<endl;
			}else{
				cout<<fact(t+n[q]-1)/fact(t-1)*mod_pow(d[q],n[q])<<endl;
			}
		}
	}
}

//{{{ main fucnction
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> Q;
	x.assign(Q,Int());
	d.assign(Q,Int());
	n.assign(Q,Int());
	for(int i = 0 ; i < Q ; i++){
		cin >> x[i];
		cin >> d[i];
		cin >> n[i];
	}
	solve();
	return 0;
}

//}}}



Measured memory_bytes: 8944