class Combination:

    '''

    計算量：階乗・逆元テーブルの作成O(N)

            nCkを求めるO(1)

    '''



    def __init__(self, n, MOD):

        self.fact = [1]

        for i in range(1, n + 1):

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

        self.inv_fact = [pow(self.fact[i] ,MOD - 2 ,MOD) for i in range(n + 1)]

        self.MOD = MOD



    def factorial(self, k):

        '''k!を求める'''

        return self.fact[k]



    def inverse_factorial(self, k):

        '''k!の逆元を求める'''

        return self.inv_fact[k]



    def combination(self, k, r):

        '''kCrを求める'''

        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD



q = int(eval(input()))

MOD = 10**6 + 3

comb = Combination(MOD, MOD)

for i in range(q):

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

    if d == 0:

        print((pow(a1, n, MOD)))

        continue

    syoko = a1 * (comb.inv_fact[d] * comb.fact[d-1])

    syoko %= MOD

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

        print((0))

    else:

        ans = pow(d, n, MOD) * comb.fact[syoko+(n-1)] * comb.inv_fact[syoko-1]

        print((ans % MOD))
class Combination:

    def __init__(self, n, MOD):

        self.fact = [1]

        for i in range(1, n + 1):

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

        self.inv_fact = [0] * (n + 1)

        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)

        for i in reversed(list(range(n))):

            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD

        self.MOD = MOD



    def factorial(self, k):

        """k!を求める O(1)"""

        return self.fact[k]



q = int(eval(input()))

info = [list(map(int, input().split())) for i in range(q)]

MOD = 1000003

comb = Combination(MOD, MOD)



for x, d, n in info:

    if d == 0:

        ans = pow(x, n, MOD)

        print(ans)

        continue



    ans = pow(d, n, MOD)

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

    

    # x_d * (x_d + 1) * (x_d + 2) * ... *(x_d + n - 1)

    tmp = comb.factorial(min(x_d + n - 1, MOD)) * pow(comb.factorial(x_d - 1), MOD - 2, MOD)

    ans *= tmp

    print((ans % MOD))

class Combination:
    """
    計算量：階乗・逆元テーブルの作成O(N)
            nCkを求めるO(1)
    """

    def __init__(self, n, MOD):
        self.fact = [1]
        for i in range(1, n + 1):
            self.fact.append(self.fact[-1] * i % MOD)
        self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)]
        self.MOD = MOD

    def factorial(self, k):
        """k!を求める"""
        return self.fact[k]

    def inverse_factorial(self, k):
        """k!の逆元を求める"""
        return self.inv_fact[k]

    def combination(self, k, r):
        """kCrを求める"""
        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD


q = int(eval(input()))
MOD = 10**6 + 3
comb = Combination(MOD, MOD)
for i in range(q):
    a1, d, n = list(map(int, input().split()))
    if d == 0:
        print((pow(a1, n, MOD)))
        continue
    syoko = a1 * (comb.inv_fact[d] * comb.fact[d - 1])
    syoko %= MOD
    if syoko == 0 or syoko + (n - 1) >= MOD:
        print((0))
    else:
        ans = pow(d, n, MOD) * comb.fact[syoko + (n - 1)] * comb.inv_fact[syoko - 1]
        print((ans % MOD))

class Combination:
    def __init__(self, n, MOD):
        self.fact = [1]
        for i in range(1, n + 1):
            self.fact.append(self.fact[-1] * i % MOD)
        self.inv_fact = [0] * (n + 1)
        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD)
        for i in reversed(list(range(n))):
            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD
        self.MOD = MOD

    def factorial(self, k):
        """k!を求める O(1)"""
        return self.fact[k]


q = int(eval(input()))
info = [list(map(int, input().split())) for i in range(q)]
MOD = 1000003
comb = Combination(MOD, MOD)
for x, d, n in info:
    if d == 0:
        ans = pow(x, n, MOD)
        print(ans)
        continue
    ans = pow(d, n, MOD)
    x_d = x * pow(d, MOD - 2, MOD) % MOD
    # x_d * (x_d + 1) * (x_d + 2) * ... *(x_d + n - 1)
    tmp = comb.factorial(min(x_d + n - 1, MOD)) * pow(
        comb.factorial(x_d - 1), MOD - 2, MOD
    )
    ans *= tmp
    print((ans % MOD))

-    """ -    計算量：階乗・逆元テーブルの作成O(N) -            nCkを求めるO(1) -    """ - -        self.inv_fact = [pow(self.fact[i], MOD - 2, MOD) for i in range(n + 1)] +        self.inv_fact = [0] * (n + 1) +        self.inv_fact[n] = pow(self.fact[n], MOD - 2, MOD) +        for i in reversed(list(range(n))): +            self.inv_fact[i] = self.inv_fact[i + 1] * (i + 1) % MOD -        """k!を求める""" +        """k!を求める O(1)""" - -    def inverse_factorial(self, k): -        """k!の逆元を求める""" -        return self.inv_fact[k] - -    def combination(self, k, r): -        """kCrを求める""" -        return (self.fact[k] * self.inv_fact[k - r] * self.inv_fact[r]) % self.MOD -MOD = 10**6 + 3 +info = [list(map(int, input().split())) for i in range(q)] +MOD = 1000003 -for i in range(q): -    a1, d, n = list(map(int, input().split())) +for x, d, n in info: -        print((pow(a1, n, MOD))) +        ans = pow(x, n, MOD) +        print(ans) -    syoko = a1 * (comb.inv_fact[d] * comb.fact[d - 1]) -    syoko %= MOD -    if syoko == 0 or syoko + (n - 1) >= MOD: -        print((0)) -    else: -        ans = pow(d, n, MOD) * comb.fact[syoko + (n - 1)] * comb.inv_fact[syoko - 1] -        print((ans % MOD)) +    ans = pow(d, n, MOD) +    x_d = x * pow(d, MOD - 2, MOD) % MOD +    # x_d * (x_d + 1) * (x_d + 2) * ... *(x_d + n - 1) +    tmp = comb.factorial(min(x_d + n - 1, MOD)) * pow( +        comb.factorial(x_d - 1), MOD - 2, MOD +    ) +    ans *= tmp +    print((ans % MOD))