#include <bits/stdc++.h>
using namespace std;
#define endl '\n'

template<typename T>
T pow(T a, long long n, T e = 1) {
    T ret = e;
    while (n) {
        if (n & 1) ret *= a;
        a *= a;
        n >>= 1;
    }
    return ret;
}

template<int mod>
struct ModInt {
    int x;
    ModInt() : x(0) {}
    ModInt(int x_) { if ((x = x_ % mod + mod) >= mod) x -= mod; }
    ModInt& operator+=(ModInt rhs) { if ((x += rhs.x) >= mod) x -= mod; return *this; }
    ModInt& operator-=(ModInt rhs) { if ((x -= rhs.x) < 0) x += mod; return *this; }
    ModInt& operator*=(ModInt rhs) { x = (unsigned long long) x * rhs.x % mod; return *this; }
    ModInt& operator/=(ModInt rhs) { x = (unsigned long long) x * rhs.inv().x % mod; return *this; }

    ModInt operator-() const { return -x < 0 ? mod - x : -x; }
    ModInt operator+(ModInt rhs) const { return ModInt(*this) += rhs; }
    ModInt operator-(ModInt rhs) const { return ModInt(*this) -= rhs; }
    ModInt operator*(ModInt rhs) const { return ModInt(*this) *= rhs; }
    ModInt operator/(ModInt rhs) const { return ModInt(*this) /= rhs; }
    bool operator==(ModInt rhs) const { return x == rhs.x; }
    bool operator!=(ModInt rhs) const { return x != rhs.x; }
    ModInt inv() const { return pow(*this, mod - 2); }

    friend ostream& operator<<(ostream& s, ModInt<mod> a) { s << a.x; return s; }
    friend istream& operator>>(istream& s, ModInt<mod>& a) { s >> a.x; return s; }
};

constexpr int MOD = 1e6 + 3;
using mint = ModInt<MOD>;


mint fact[MOD];
mint factinv[MOD];

void init() {
    fact[0] = 1;
    for (int i = 1; i < MOD; i++) {
        fact[i] = fact[i - 1] * i;
    }
    factinv[MOD - 1] = fact[MOD - 1].inv();
    for (int i = MOD - 2; i >= 0; i--) {
        factinv[i] = factinv[i + 1] * (i + 1);
    }
    assert(factinv[0] == 1);
}

mint rfact(int x, int r) {
//    cerr << x << ' ' << r << ' ' << x + r << ' ' << MOD << endl;
    if (x + r - 1 >= MOD) return 0;// fact[x + r - MOD] * factinv[x - 1];
    return fact[x + r - 1] * factinv[x - 1];
}

mint hoge(int x, int d, int n) {
    mint ret(1);
    for (int i = 0; i < n; i++) {
        ret *= mint(x) + mint(d) * i;
    }
    return ret;
}

void test() {
    random_device rnd;
    while (1) {
        int x = rnd() % MOD, d = rnd() % MOD, n = rnd() % 200;
//        int x = 133552, d = 983071, n = 126;
        if (x == 0 || d == 0) continue;
        if (hoge(x, d, n) !=  pow(mint(d), n) * rfact((mint(x) / mint(d)).x, n)) {
            cout << x << ' ' << d << ' ' << n << endl;
            cout << hoge(x, d, n) << ' ' <<  pow(mint(d), n) * rfact((mint(x) / mint(d)).x, n) << endl;
            return;
        }
    }
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    init();

    int q;
    cin >> q;
    while (q--) {
        int x, d, n;
        cin >> x >> d >> n;
        if (x == 0) {
            // さすがにあってる
            cout << 0 << '\n';
            continue;
        }

        if (d) {
            mint ans = pow(mint(d), n) * rfact((mint(x) / mint(d)).x, n);
            cout << ans << endl;
        } else {
            // さすがにあってる
            cout << pow(mint(x), n) << endl;
        }
    }

//    test();
}


Measured memory_bytes: 8704