import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf3 = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_003;

ModComb mc;

void main() {
    int Q;
    scan(Q);

    mc = ModComb(mod - 1, mod);

    foreach (_ ; 0 .. Q) {
        int xi, di, ni;
        scan(xi, di, ni);
        writeln(solve(xi, di, ni));
    }
}


long solve(int x, int d, int n) {
    if (d == 0) {
        return powmod(x, n, mod);
    }
    if (n >= mod) {
        return 0;
    }
    if (x == 0) {
        return powmod(d, n, mod) * mc.f(n - 1) % mod;
    }

    auto xpd = x * powmod(d, mod - 2, mod) % mod;

    if (xpd + n - 1 >= mod) {
        return 0;
    }

    long ans = mc.f(xpd + n - 1) * mc.finv(xpd - 1) % mod;
    ans *= powmod(d, n, mod);
    ans %= mod;

    return ans;
}


long powmod(long x, long n, long mod) {
    return n > 0 ? powmod(x, n>>1, mod)^^2 % mod * x^^(n&1) % mod : 1;
}


struct ModComb {
    int _N;
    long[] _fact, _factinv;
    long _mod;

    this(int n, long mod = 1_000_000_007L) {
        _N = n;
        _fact = new long[](_N + 1);
        _factinv = new long[](_N + 1);
        _mod = mod;

        _fact[0] = 1;
        foreach (i ; 1 .. _N + 1) {
            _fact[i] = (_fact[i-1] * i) % _mod;
        }

        _factinv[_N] = _powmod(_fact[_N], _mod - 2);
        foreach_reverse (i ; 0 .. _N) {
            _factinv[i] = (_factinv[i+1] * (i+1)) % _mod;
        }
    }

    long c(int n, int k) {
        return f(n) * finv(n - k) % _mod * finv(k) % _mod;
    }

    long p(int n, int r) {
        return f(n) * finv(n - r) % _mod;
    }

    long f(long n) {
        return _fact[n.to!int];
    }

    long finv(long n) {
        return _factinv[n.to!int];
    }

    long _powmod(long x, long y) {
        return y > 0 ? _powmod(x, y>>1)^^2 % _mod * x^^(y & 1) % _mod : 1;
    }
}
















int[][] readGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new int[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v;
        scan(u, v);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= v;
        if (isUndirected) {
            adj[v] ~= u;
        }
    }

    return adj;
}

alias Edge = Tuple!(int, "to", int, "cost");

Edge[][] readWeightedGraph(int n, int m, bool isUndirected = true, bool is1indexed = true) {
    auto adj = new Edge[][](n, 0);

    foreach (i; 0 .. m) {
        int u, v, c;
        scan(u, v, c);
        if (is1indexed) {
            u--, v--;
        }
        adj[u] ~= Edge(v, c);
        if (isUndirected) {
            adj[v] ~= Edge(u, c);
        }
    }

    return adj;
}

void yes(bool b) {
    writeln(b ? "Yes" : "No");
}

void YES(bool b) {
    writeln(b ? "YES" : "NO");
}

T[] readArr(T)() {
    return readln.split.to!(T[]);
}

T[] readArrByLines(T)(int n) {
    return iota(n).map!(i => readln.chomp.to!T).array;
}

void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


Measured memory_bytes: 20860