var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
  
var q = arr[0]
 
for var i in 0..<q {
	var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
	var sum = 0; var x = arr[0]; var y = x
  
  	sum = arr[0]
	for var j in 1..<arr[2] {
      y += arr[1]
      sum = sum * y
      if( sum > 1000003 ) { 
      	sum %= 1000003
      }
    }  
	print( sum )
}