CodeEff/ECCO huggingface dataset:
# Original solution
import sys
input = sys.stdin.readline
MOD = 10**6+3
q = int(eval(input()))

fact = [1]*(MOD+1)
for i in range(1, MOD+1):
    fact[i] = fact[i-1]*i%MOD
finv = [pow(f, MOD-2, MOD) for f in fact]

for _ in range(q):
    x, d, n = list(map(int, input().split()))
    if d == 0:
        ans = pow(x, n, MOD)
    else:
        x_div = x*pow(d, MOD-2, MOD)%MOD
        if x_div+n-1 > MOD:
            ans = 0
        else:

            if x_div+n-1 >= MOD:
                ans = 0
            else:
                ans = fact[x_div+n-1]*finv[x_div-1]%MOD*pow(d, n, MOD)%MOD
    print(ans)


# Optimized solution
import sys
input = sys.stdin.readline
MOD = 10**6+3
q = int(eval(input()))

fact = [1]*(MOD+1)
for i in range(1, MOD+1):
    fact[i] = fact[i-1]*i%MOD

for _ in range(q):
    x, d, n = list(map(int, input().split()))
    if d == 0:
        ans = pow(x, n, MOD)
    else:
        x_div = x*pow(d, MOD-2, MOD)%MOD
        if x_div+n-1 > MOD:
            ans = 0
        else:

            if x_div+n-1 >= MOD:
                ans = 0
            else:
                f = fact[x_div+n-1]
                fi = pow(fact[x_div-1], MOD-2, MOD)
                ans = f*fi%MOD*pow(d, n, MOD)%MOD
    print(ans)
# Original solution
M=1000003
f=[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*pow(d,M-2,M)%M
	print(([pow(x,n,M),(M-n>=t>0)*1and f[t+n-1]*pow(f[t-1],M-2,M)*pow(d,n,M)%M][d>0]))

# Optimized solution
M,f=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*pow(d,M-2,M)%M;print(([pow(x,n,M),(M-n>=t>0)*1and f[t+n-1]*pow(f[t-1],M-2,M)*pow(d,n,M)%M][d>0]))
# Original solution
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])

# Optimized solution
p,M=pow,1000003
f=[1]*M
for i in range(1,M):f[i]=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])
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

MOD = 1000003


class ModInt(object):

  def __init__(self, num, mod):
    self.num = num
    self.mod = mod

    if self.num >= self.mod:
      self.num %= self.mod

  def inv(self):
    a, b, u, v = self.mod, self.num, 0, 1

    while b != 0:
      t = a // b
      a -= t * b
      u -= t * v
      a, b = b, a
      u, v = v, u

    return ModInt(u % self.mod, self.mod)

  def __add__(self, n):
    raise NotImplementedError()

  def __sub__(self, n):
    raise NotImplementedError()

  def __mul__(self, n):
    return ModInt((self.num * int(n)) % self.mod, self.mod)

  def __div__(self, n):
    raise NotImplementedError()

  def __pow__(self, n):
    v = 1
    m = self.num

    while n != 0:
      if n & 1 != 0:
        v = (v * m) % self.mod

      m = (m * m) % self.mod
      n = n >> 1

    return ModInt(v, self.mod)

  def __int__(self):
    return self.num

  def __str__(self):
    return str(self.num)


def main():
  facs = [None] * MOD
  facs[0] = ModInt(1, MOD)

  for i in range(1, MOD):
    facs[i] = facs[i - 1] * i

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

    if d == 0:
      print((ModInt(x, MOD) ** n))
      continue

    x = int(ModInt(x, MOD) * ModInt(d, MOD).inv())

    if x + n - 1 >= MOD:
      print((0))
      continue

    v = facs[x + n - 1]

    if x != 0:
      v *= facs[x - 1].inv()

    if d != 1:
      v *= (ModInt(d, MOD) ** n)

    print(v)


if __name__ == '__main__':
  main()



# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

MOD = 1000003


def inv(x, m):
  y, u, v = m, 1, 0

  while y != 0:
    t = x // y
    x -= t * y
    u -= t * v
    x, y = y, x
    u, v = v, u

  return u % m


def main():
  facs = [None] * MOD
  invs = [None] * MOD

  facs[0] = 1
  for i in range(1, MOD):
    facs[i] = facs[i - 1] * i % MOD

  invs[-1] = facs[-1]
  for i in range(MOD - 1, 0, -1):
    invs[i - 1] = invs[i] * i % MOD

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

    if d == 0:
      print((pow(x, n, MOD)))
      continue

    x = x * inv(d, MOD) % MOD

    if x + n - 1 >= MOD:
      print((0))
      continue

    v = facs[x + n - 1]

    if x != 0:
      v = v * invs[x - 1] % MOD

    if d != 1:
      v = v * pow(d, n, MOD) % MOD

    print(v)


if __name__ == '__main__':
  main()
# Original solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
from operator import mul

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


def mod_mul(x, y):
    return mul(x, y) % MOD


fact = [1]
for n in range(1, MOD):
    fact.append(mod_mul(fact[-1], n))
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

Q = int(eval(input()))
for _ 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 = mod_mul(x, inv(d))
    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print((mod_mul(mod_mul(fact[xd + n - 1], inv(fact[xd - 1])), dn)))


# Optimized solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
from operator import mul
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


def mod_mul(x, y):
    return mul(x, y) % MOD


fact = [1]
for n in range(1, MOD):
    fact.append(mod_mul(fact[-1], n))
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

Q = int(eval(input()))
for _ 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 = mod_mul(x, inv(d))
    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print((mod_mul(mod_mul(fact[xd + n - 1], inv(fact[xd - 1])), dn)))
# Original solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
from operator import mul
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


def mod_mul(x, y):
    return mul(x, y) % MOD


fact = [1]
for n in range(1, MOD):
    fact.append(mod_mul(fact[-1], n))
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

Q = int(eval(input()))
for _ 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 = mod_mul(x, inv(d))
    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print((mod_mul(mod_mul(fact[xd + n - 1], inv(fact[xd - 1])), dn)))


# Optimized solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
from functools import reduce
from operator import mul
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


def mod_mul(x, y):
    return mul(x, y) % MOD


fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

Q = int(eval(input()))
for _ 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 * inv(d)) % MOD
    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print((reduce(mod_mul, (fact[xd + n - 1], inv(fact[xd - 1]), dn))))
# Original solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
from functools import reduce
from operator import mul
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = inv(fact[-1])
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(eval(input()))
for _ 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 * inv(d)) % MOD
    if xd == 0:
        print((0))
        continue
        
    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print(((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD))


# Optimized solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = inv(fact[-1])
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(eval(input()))
for _ 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 * inv(d)) % MOD
    if xd == 0:
        print((0))
        continue

    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print(((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD))
# Original solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3


def inv(n):
    return pow(n, MOD - 2, MOD)


fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = inv(fact[-1])
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(eval(input()))
for _ 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 * inv(d)) % MOD
    if xd == 0:
        print((0))
        continue

    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print(((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD))


# Optimized solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3

fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = pow(fact[-1], MOD - 2, MOD)
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(eval(input()))
for _ 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 == 0:
        print((0))
        continue

    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print(((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD))
# Original solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3

fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = pow(fact[-1], MOD - 2, MOD)
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(eval(input()))
for _ 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 == 0:
        print((0))
        continue

    if MOD - xd < n:
        print((0))
        continue

    dn = pow(d, n, MOD)
    print(((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD))


# Optimized solution
# https://atcoder.jp/contests/m-solutions2019/submissions/5741430
import sys

input = sys.stdin.readline

MOD = 10 ** 6 + 3

fact = [1]
for n in range(1, MOD):
    fact.append((fact[-1] * n) % MOD)
    # d>1 の数列を d=1 となる数列に変換する
    # MODの倍数を含む数列の積は0になるので,
    # MODの倍数を含まない区間の積が計算できればよい
    # そのような区間の右端はMOD-1であり,fact[MOD-1]が計算できればよい

inv_fact = [-1] * MOD
inv_fact[MOD - 1] = pow(fact[-1], MOD - 2, MOD)
for n in range(MOD - 2, -1, -1):
    inv_fact[n] = ((inv_fact[n + 1] * (n + 1)) % MOD)
    # inv_factは,inv(n!)にn,n-1,...を掛けるイメージ

Q = int(input())
ans = []
for _ in range(Q):
    x, d, n = map(int, input().split())

    if x == 0:
        ans.append(0)
        continue

    if d == 0:
        ans.append(pow(x, n, MOD))
        continue

    xd = (x * pow(d, MOD - 2, MOD)) % MOD
    if xd == 0:
        ans.append(0)
        continue

    if MOD - xd < n:
        ans.append(0)
        continue

    dn = pow(d, n, MOD)
    ans.append((((fact[xd + n - 1] * inv_fact[xd - 1]) % MOD) * dn) % MOD)
print(*ans, sep='\n')
# Original solution
import sys
input = sys.stdin.readline
q = int(eval(input()))

p=1000003

for j in range(q):
  x,d,n=(int(i) for i in input().split())

  cnt=0
  data1=1
  for i in range(p-2):
    cnt+=1
    data1*=d
    data1=data1%p
  data2=(x*data1)%p

  data3=1
  for i in range(n):
    data3*=(data2+i)
    data3=data3%p
  
  for i in range(n):
    data3*=d
    data3=data3%p
    
  print(data3)

# Optimized solution
import sys
input = sys.stdin.readline
q = int(eval(input()))

p=1000003

flist=[1 for i in range(p)]
for i in range(1,p):
    flist[i]=flist[i-1]*i%p

for i in range(q):
  x,d,n=(int(i) for i in input().split())
  if d==0:
    ans=pow(x,n,p)
  else:
    x=x*pow(d,p-2,p)%p    
    if p<=x+n-1:
      ans=0
    else:
      ans=pow(d,n,p)*flist[x+n-1]*pow(flist[x-1],p-2,p)%p
  print((ans%p))
# Original solution
MOD = 10**6+3

def main():
    # preprocess
    fac = [1, 1]
    f_inv = [1, 1]
    inv = [0, 1]

    for i in range(2, MOD+1):
        fac.append((fac[-1] * i) % MOD)
        inv.append((-inv[MOD % i] * (MOD//i)) % MOD)
        f_inv.append((f_inv[-1] * inv[-1]) % MOD)

    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, input().split()))

        if d == 0:
            print((pow(x, n, MOD)))
            continue
        
        xd = ((x % MOD) * 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)] * f_inv[xd - 1] % MOD))


if __name__ == "__main__":
    main()

# Optimized solution
MOD = 10**6+3

def main():
    # preprocess
    fac = [1, 1]
    f_inv = [1, 1]
    inv = [0, 1]

    for i in range(2, MOD+1):
        fac.append((fac[-1] * i) % MOD)
        inv.append((-inv[MOD % i] * (MOD//i)) % MOD)
        f_inv.append((f_inv[-1] * inv[-1]) % MOD)

    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, input().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)] * f_inv[xd-1] % MOD))


if __name__ == "__main__":
    main()
# Original solution
MOD = 10**6+3

def main():
    # preprocess
    fac = [1, 1]
    f_inv = [1, 1]
    inv = [0, 1]

    for i in range(2, MOD+1):
        fac.append((fac[-1] * i) % MOD)
        inv.append((-inv[MOD % i] * (MOD//i)) % MOD)
        f_inv.append((f_inv[-1] * inv[-1]) % MOD)

    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, input().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)] * f_inv[xd-1] % MOD))


if __name__ == "__main__":
    main()

# Optimized solution
MOD = 10**6+3

def main():
    # preprocess
    fac = [1, 1]
    for i in range(2, MOD+1):
        fac.append((fac[-1] * i) % MOD)

    Q = int(eval(input()))
    for i in range(Q):
        x, d, n = list(map(int, input().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()
# Original solution
####################
#  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()

# Optimized solution
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()
# Original solution
Q = int(eval(input()))
mod = 10**6+3
arr = []
for i in range(Q):
    x, d, n = list(map(int, input().split()))
    arr.append([x, d, n])

P = [1]*(mod+1)
for i in range(mod):
    P[i+1] = P[i]*(i+1)%mod

def rev(a):
    return pow(a,mod-2,mod)

def f(x, d, n):
    if d == 0:
        return pow(x, n, mod)
    else:
        d_r = rev(d)
        if d_r * x % mod == 0:
            return 0
        elif (d_r*x%mod+n-1) >= mod:
            return 0
        else:
            return (P[d_r*x%mod+n-1] * rev(P[d_r*x%mod-1])%mod)*pow(d,n,mod)%mod

for i in range(Q):
    print((f(arr[i][0], arr[i][1], arr[i][2])))


# Optimized solution
Q = int(eval(input()))
mod = 10**6+3
arr = []
for i in range(Q):
    arr.append(list(map(int, input().split())))

P = [1]*(mod+1)
for i in range(mod):
    P[i+1] = P[i]*(i+1)%mod

def rev(a):
    return pow(a,mod-2,mod)

def f(x, d, n):
    if d == 0:
        return pow(x, n, mod)
    else:
        d_r = rev(d)
        xdr = d_r * x % mod 
        if xdr == 0:
            return 0
        elif (xdr+n-1) >= mod:
            return 0
        else:
            return (P[xdr+n-1] * rev(P[xdr-1])%mod) * pow(d,n,mod)%mod

for i in range(Q):
    print((f(arr[i][0], arr[i][1], arr[i][2])))
# Original solution
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))

# Optimized solution
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))