#include <bits/stdc++.h>
using namespace std;
const int N = 110;
const int mod = 1e6 + 3;
int n;
struct Matrix {
  long long x[N][N];
  void print() {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        printf("%I64d ", x[i][j]);
      }
      puts("");
    }
  }
};
long long dp[N], H[N];
Matrix A, S, C;
Matrix mul(Matrix &A, Matrix &B) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) C.x[i][j] = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < n; k++) {
      for (int j = 0; j < n; j++) {
        C.x[i][j] = C.x[i][j] + A.x[i][k] * B.x[k][j];
        if (C.x[i][j] >= mod) {
          C.x[i][j] %= mod;
        }
      }
    }
  }
  return C;
}
Matrix mat_pow(int p) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      S.x[i][j] = i == j ? 1 : 0;
    }
  }
  while (p) {
    if (p & 1) S = mul(S, A);
    A = mul(A, A);
    p >>= 1;
  }
  return S;
}
int main() {
  int c, w, h;
  while (~scanf("%d %d %d", &c, &w, &h)) {
    dp[0] = 1;
    H[0] = 1;
    for (int i = 1; i <= w; i++) {
      H[i] = H[i - 1] * h % mod;
    }
    for (int i = 1; i <= w + 1; i++) {
      dp[i] = 0;
      for (int j = 0; j < i; j++) {
        dp[i] = (dp[i] + dp[j] * H[i - j - 1] % mod) % mod;
      }
    }
    if (c <= w) {
      printf("%I64d\n", dp[c + 1]);
      continue;
    }
    n = w + 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        A.x[i][j] = 0;
      }
    }
    for (int i = 0; i < n; i++) {
      A.x[i][0] = H[i];
    }
    for (int i = 1; i < n; i++) {
      A.x[i - 1][i] = 1;
    }
    A = mat_pow(c + 1 - w);
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      ans = (ans + dp[w - i] * A.x[i][0] % mod) % mod;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
