import Data.Bits
import Data.Foldable (foldlM,foldrM)
import Data.Maybe (fromJust)
import Data.List
import qualified Data.Vector.Unboxed.Mutable as V
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

doQuery :: IO Int
doQuery = do
  [x,d,n] <- map read. words <$> getLine :: IO [Int]
  if n >= 1000003 then return 0
    else  return $ product' [mod' $ x + k*d | k <- [0..n-1]]


main :: IO ()
main = do
  q <- readLn :: IO Int
  replicateM_ q $ do
    ans <- doQuery
    print $ mod' ans

product' :: [Int] -> Int
product' = foldl1 (\x y -> mod' $ x*y)

mod' :: Int -> Int
mod' n = if n <= 1000003 then n else n `mod` 1000003
