local bls, brs = bit.lshift, bit.rshift
local mod = 1000003
local function badd(x, y) return (x + y) % mod end
local function bmul(x, y) return (x * y) % mod end

local function modpow(src, pow)
  local res = 1
  while 0 < pow do
    if pow % 2 == 1 then
      res = bmul(res, src)
      pow = pow - 1
    end
    src = bmul(src, src)
    pow = brs(pow, 1)
  end
  return res
end

local function modinv(src)
  return modpow(src, mod - 2)
end

local fact = {1}
for i = 2, mod - 1 do
  fact[i] = bmul(fact[i - 1], i)
end

local q = io.read("*n")
for iq = 1, q do
  local x, d, n = io.read("*n", "*n", "*n")
  if d == 0 then
    print(modpow(x, n))
  else
    local a = bmul(x, modinv(d))
    local lim = a + n - 1
    if mod <= lim then
      print(0)
    else
      local numer = fact[lim]
      numer = bmul(numer, modpow(d, n))
      local denom = 1
      if 1 < a then
        denom = fact[a - 1]
      end
      local ret = bmul(numer, modinv(denom))
      print(ret)
    end
  end
end
