MOD = 1000003

q = int(eval(input()))

cumprod = [1]

for i in range(1, MOD):

	cumprod.append((cumprod[-1] * i) % MOD)



def calc(l, r):

	return (cumprod[r] * pow(cumprod[l-1], MOD-2, MOD)) % MOD



def solve(x, d, n):

	if x == 0:

		return 0

	elif d == 0:

		return pow(x, n, MOD)

	else:

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

		if l+n-1 >= MOD:

			return 0

		else:

			return (calc(l, l+n-1) * pow(d, n, MOD)) % MOD



for _ in range(q):

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

	print((solve(x, d, n)))
import sys

def input():

	return sys.stdin.readline()[:-1]



MOD = 1000003

q = int(eval(input()))

cumprod = [1]

for i in range(1, MOD):

	cumprod.append((cumprod[-1] * i) % MOD)



def calc(l, r):

	return (cumprod[r] * pow(cumprod[l-1], MOD-2, MOD)) % MOD



def solve(x, d, n):

	if x == 0:

		return 0

	elif d == 0:

		return pow(x, n, MOD)

	else:

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

		if l+n-1 >= MOD:

			return 0

		else:

			return (calc(l, l+n-1) * pow(d, n, MOD)) % MOD



for _ in range(q):

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

	print((solve(x, d, n)))
MOD = 1000003
q = int(eval(input()))
cumprod = [1]
for i in range(1, MOD):
    cumprod.append((cumprod[-1] * i) % MOD)


def calc(l, r):
    return (cumprod[r] * pow(cumprod[l - 1], MOD - 2, MOD)) % MOD


def solve(x, d, n):
    if x == 0:
        return 0
    elif d == 0:
        return pow(x, n, MOD)
    else:
        l = (x * pow(d, MOD - 2, MOD)) % MOD
        if l + n - 1 >= MOD:
            return 0
        else:
            return (calc(l, l + n - 1) * pow(d, n, MOD)) % MOD


for _ in range(q):
    x, d, n = list(map(int, input().split()))
    print((solve(x, d, n)))

import sys


def input():
    return sys.stdin.readline()[:-1]


MOD = 1000003
q = int(eval(input()))
cumprod = [1]
for i in range(1, MOD):
    cumprod.append((cumprod[-1] * i) % MOD)


def calc(l, r):
    return (cumprod[r] * pow(cumprod[l - 1], MOD - 2, MOD)) % MOD


def solve(x, d, n):
    if x == 0:
        return 0
    elif d == 0:
        return pow(x, n, MOD)
    else:
        l = (x * pow(d, MOD - 2, MOD)) % MOD
        if l + n - 1 >= MOD:
            return 0
        else:
            return (calc(l, l + n - 1) * pow(d, n, MOD)) % MOD


for _ in range(q):
    x, d, n = list(map(int, input().split()))
    print((solve(x, d, n)))

+import sys + + +def input(): +    return sys.stdin.readline()[:-1] + +