#include <bits/stdc++.h>

using namespace std;
using ll = long long;
ll mod = 1000003;
ll fact[1111111];

ll po(ll a, ll b)
{
  if (b == 0)return 1;
  ll z = po(a, b / 2);
  z = z*z%mod;
  if (b % 2 == 1)z = z*a%mod;
  return z;
}
ll inv(ll a)
{
  return po(a, mod - 2);
}

int main() {
  ll Q;
  cin >> Q;
  fact[0] = 1;
  for (int i = 0; i < mod + 10; i++)
    fact[i + 1] = fact[i] * (i + 1) % mod;
  ll x[Q], d[Q], n[Q];
  for (int i = 0; i < Q; ++i) {
    cin >> x[i] >> d[i] >> n[i];
  }
  for (int i = 0; i < Q; ++i) {
    if (d[i]==0)
      cout << po(x[i], n[i]) << endl;
    else{
      ll first=x[i]*inv(d[i])%mod;
      ll end=first+n[i]-1;
      if(first<=mod && mod <= end)
        cout << 0 << endl;
      else{
        ll a = fact[end]*inv(fact[first-1]) % mod;
        cout << a*po(d[i],n[i]) %mod << endl;
      }
    }
  }

}
