#include <iostream>
#include <vector>
#include <algorithm>

#define ll long long
using namespace std;

ll mod = 1000003;

ll calc_pow(ll x, ll pow) {
    if (pow == 0) return 1;
    ll a = calc_pow(x, pow / 2);
    a = a * a % mod;
    if (pow % 2 == 1) a *= x;
    return a % mod;
}

ll waru(ll a, ll b) {
    return a * calc_pow(b % mod, mod - 2) % mod;
}

int main() {
    vector<ll> fact(mod);
    fact[0] = 1;
    for (int i = 1; i < mod; i++) fact[i] = fact[i - 1] * i % mod;

    int q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        ll x, d, n;
        cin >> x >> d >> n;
        if (d == 0)cout << calc_pow(x, n) << endl;
        else {
            ll a = waru(x, d);
            if (a + n - 1 >= mod)cout << 0 << endl;
            else {
                cout << waru(fact[a + n - 1], fact[a - 1]) * calc_pow(d, n) % mod << endl;
            }
        }
    }
    return 0;
}