import scala.io.StdIn._

object Main extends App {
  def m(s: String): Long = {
    val input = s.split(" ").map(_.toInt).toList
    val x = input.head
    val d = input(1)
    var res: BigDecimal = x
    for (n <- 1 until input(2)) {
      res = res * (x + (BigDecimal(d) * BigDecimal(n) % BigDecimal(1000003)))
      res %= 1000003
    }
    res.toInt
  }
  
  for (_ <- 1 to readInt())
    println(m(readLine()))
}