def powmod(b,r,mod)
  a = 1
  while r > 0
    if r%2 == 1
      a = a * b % mod
    end
    b = b * b % mod
    r /= 2
  end
  a
end
 
def invmod(f, mod)
  powmod(f, mod-2, mod)
end


Mod = 1000003
fs = [1]
(1...Mod).each{ |n|
  fs << (fs[-1] * n % Mod)
}
Q = gets.to_i
Q.times {
  x,d,n = gets.split.map &:to_i
  if d == 0
    p powmod(x, n, Mod)
    next
  end

  id = invmod(d, Mod)
  b = x * id % Mod
  if b+n-1 >= Mod
    p 0
    next
  end
  dn = powmod(d, n, Mod) 
  fact = fs[b+n-1]
  invf = invmod(fs[b-1], Mod)
  p dn * fact % Mod * invf % Mod
}

