class Cal
	def cal(x,d,n)
      mod      = 1000003
      previous = 1
      result   = 1
      n.times do |i|
        this_time = x + i*d
        result    = result * this_time
        previous  = this_time
      end
      puts result % mod
    end
end

q = gets.chomp.to_i
q.times do
  x,d,n = gets.chomp.split.map(&:to_i)
  Cal.new.cal(x,d,n)
end
  

