p,M,f=pow,1000003,[1]

for i in range(1,M):f.append(f[i-1]*i%M)

for _ in'_'*int(eval(input())):x,d,n=list(map(int,input().split()));t=x*p(d,M-2,M)%M;print(([p(x,n,M),M//(t+n)*t and f[t+n-1]*p(f[t-1],M-2,M)*p(d,n,M)%M][d>0]))
p,M,f=pow,1000003,[1]

for i in range(1,M):f.append(f[i-1]*i%M)

for _ in'_'*eval(input()):x,d,n=list(map(int,input().split()));t=x*p(d,M-2,M)%M;print(([p(x,n,M),M/(t+n)*t and f[t+n-1]*p(f[t-1],M-2,M)*p(d,n,M)%M][d>0]))
p, M, f = pow, 1000003, [1]
for i in range(1, M):
    f.append(f[i - 1] * i % M)
for _ in "_" * int(eval(input())):
    x, d, n = list(map(int, input().split()))
    t = x * p(d, M - 2, M) % M
    print(
        (
            [
                p(x, n, M),
                M // (t + n) * t
                and f[t + n - 1] * p(f[t - 1], M - 2, M) * p(d, n, M) % M,
            ][d > 0]
        )
    )

p, M, f = pow, 1000003, [1]
for i in range(1, M):
    f.append(f[i - 1] * i % M)
for _ in "_" * eval(input()):
    x, d, n = list(map(int, input().split()))
    t = x * p(d, M - 2, M) % M
    print(
        (
            [
                p(x, n, M),
                M / (t + n) * t
                and f[t + n - 1] * p(f[t - 1], M - 2, M) * p(d, n, M) % M,
            ][d > 0]
        )
    )

-for _ in "_" * int(eval(input())): +for _ in "_" * eval(input()): -                M // (t + n) * t +                M / (t + n) * t