class Cal
	def cal(x,d,n)
      mod      = 1000003
      sequence = []
      n.times{|i| sequence << x + i*d }
      puts sequence.inject(:*) % 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




