####################

#  AC:     ms (PyPy)

####################



def main():

    MOD = 10**6+3

    # preprocess

    fac = [None] * (MOD+1)

    fac[0] = fac[1] = 1

    for i in range(2, MOD+1):

        fac[i] = (fac[i-1] * i) % MOD



    Q = int(eval(input()))

    for i in range(Q):

        x, d, n = list(map(int, input().split()))



        if x == 0:

            print((0))

            continue



        if d == 0:

            print((pow(x, n, MOD)))

            continue

        

        xd = (x * pow(d, MOD-2, MOD)) % MOD

        if xd + (n-1) >= MOD:

            print((0))

            continue



        print((pow(d, n, MOD) * fac[xd+(n-1)] * pow(fac[xd-1], MOD-2, MOD) % MOD))





if __name__ == "__main__":

    main()
import sys



def main():

    MOD = 10**6+3



    # preprocess

    fac = [None] * (MOD+1)

    fac[0] = fac[1] = 1

    for i in range(2, MOD+1):

        fac[i] = (fac[i-1] * i) % MOD



    Q = int(eval(input()))

    for i in range(Q):

        x, d, n = list(map(int, sys.stdin.readline().split()))



        if d == 0:

            print((pow(x, n, MOD)))

            continue

        

        xd = (x * pow(d, MOD-2, MOD)) % MOD

        if xd == 0 or xd + (n-1) >= MOD:

            print((0))

            continue



        print((pow(d, n, MOD) * fac[xd+(n-1)] * pow(fac[xd-1], MOD-2, MOD) % MOD))





if __name__ == "__main__":

    main()
####################
#  AC:     ms (PyPy)
####################
def main():
    MOD = 10**6 + 3
    # preprocess
    fac = [None] * (MOD + 1)
    fac[0] = fac[1] = 1
    for i in range(2, MOD + 1):
        fac[i] = (fac[i - 1] * i) % MOD
    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, input().split()))
        if x == 0:
            print((0))
            continue
        if d == 0:
            print((pow(x, n, MOD)))
            continue
        xd = (x * pow(d, MOD - 2, MOD)) % MOD
        if xd + (n - 1) >= MOD:
            print((0))
            continue
        print(
            (pow(d, n, MOD) * fac[xd + (n - 1)] * pow(fac[xd - 1], MOD - 2, MOD) % MOD)
        )


if __name__ == "__main__":
    main()

import sys


def main():
    MOD = 10**6 + 3
    # preprocess
    fac = [None] * (MOD + 1)
    fac[0] = fac[1] = 1
    for i in range(2, MOD + 1):
        fac[i] = (fac[i - 1] * i) % MOD
    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, sys.stdin.readline().split()))
        if d == 0:
            print((pow(x, n, MOD)))
            continue
        xd = (x * pow(d, MOD - 2, MOD)) % MOD
        if xd == 0 or xd + (n - 1) >= MOD:
            print((0))
            continue
        print(
            (pow(d, n, MOD) * fac[xd + (n - 1)] * pow(fac[xd - 1], MOD - 2, MOD) % MOD)
        )


if __name__ == "__main__":
    main()

-#################### -#  AC:     ms (PyPy) -#################### +import sys + + -        x, d, n = list(map(int, input().split())) -        if x == 0: -            print((0)) -            continue +        x, d, n = list(map(int, sys.stdin.readline().split())) -        if xd + (n - 1) >= MOD: +        if xd == 0 or xd + (n - 1) >= MOD: