#include <bits/stdc++.h>
using namespace std;
const int mod = int(1e6) + 3;
long long r[148];
long long h[148];
int main() {
  int c, w, th;
  cin >> c >> w >> th;
  w++;
  h[0] = 1;
  for (int i = 1; i <= w; i++) h[i] = (h[i - 1] * th) % mod;
  long long res = 0;
  r[w - 1] = 1;
  r[w - 2] = 1;
  long long s = th + 1;
  for (int i = 0; i < c; i++) {
    long long t = s;
    s -= r[i % w] * h[w - 1];
    s %= mod;
    if (s < 0) s += mod;
    s *= th;
    r[i % w] = t;
    s += r[i % w];
    s %= mod;
  }
  res = r[(c - 1) % w] % mod;
  cout << res << endl;
  return 0;
}
