using System;
using System.Collections.Generic;

public class CSharp
{
    public static void Main()
    {
        Kyopuro chokudai = new Kyopuro();
        chokudai.AtCoder();
    }
}

public class Kyopuro
{
    string s;
    int q;
    int[] x, d, n;

    public void AtCoder()
    {
        q = int.Parse(Console.ReadLine());
        string[] input;
        int[] x = new int[q];
        int[] d = new int[q];
        int[] n = new int[q];
        for (int i=0; i<q; i++)
        {
            input = Console.ReadLine().Split(' ');
            x[i] = int.Parse(input[0]);
            d[i] = int.Parse(input[1]);
            n[i] = int.Parse(input[2]);
        }

        Mod mod = new Mod(1);
        int p = 1000003;

        long[] a = new long[p];
        a[1] = 1;
        for(int i=2; i<p; i++)
        {
            a[i] = a[i - 1] * i;
            a[i] %= p;
        }

        long y = 0;
        long z = 0;
        long ans = 0;
        for(int i=0; i<q; i++)
        {
            if(x[i] == 0)
            {
                Console.WriteLine(0);
                continue;
            }
            if(d[i] == 0)
            {
                Console.WriteLine(mod.Pow(x[i], n[i]));
                continue;
            }

            y = x[i];
            y = y * mod.Pow(d[i], p - 2) % p;
            z = mod.Pow(d[i], n[i]);
            if(n[i] == 1)
            {
                Console.WriteLine(x[i]);
                continue;
            }
            if(y == 0)
            {
                Console.WriteLine(0);
                continue;
            }
            if(y + n[i] - 1 < p)
            {
                ans = a[y + n[i] - 1];
                if(y > 1) ans = ans * mod.Pow((int)a[y - 1], p - 2);
                ans %= p;
                ans *= z;
                ans %= p;
                Console.WriteLine(ans);
                continue;
            }
            else
            {
                Console.WriteLine(0);
                continue;
            }
        }
        
        
        
    }
    public static void DebugWL(object x) { System.Diagnostics.Debug.WriteLine(x); }
}

// Mod(int n)
// int[] fac: factors (1-indexed)
// int n: the length of fac

// int .Ncr(n,r): nCr
// int .Fac(n): n!%p
// int .Pow(n,m): n^m%p

public class Mod
{
    const int p = 1000003;
    int[] fac;

    public Mod(int n)
    {
        fac = new int[n + 1];
        for (int i = 1; i <= n; i++) fac[i] = -1;
        fac[0] = 1;
    }

    public int Ncr(int n, int r)
    {
        if (n < r) return 0;
        if (r == 0 | n == r) return 1;
        long a = Fac(n);
        a = a * Pow(Fac(n - r), p - 2) % p;
        a = a * Pow(Fac(r), p - 2) % p;
        return (int)a;
    }

    public int Fac(int n)
    {
        if (fac[n] >= 0) return fac[n];
        long k = 1;
        for (long i = 1; i <= n; i++)
        {
            k = k * i % p;
        }
        fac[n] = (int)k;
        return fac[n];
    }

    public int Pow(int n, int m)
    {
        if (m == 0) return 1;
        if (m == 1) return n;
        long a = 1;
        if (m % 2 == 0)
        {
            a = Pow(n, m / 2);
            a = a * a % p;
        }
        else
        {
            a = Pow(n, m / 2);
            a = a * a % p;
            a = a * n % p;
        }
        return (int)a;
    }
}


Measured memory_bytes: 26684