#include <bits/stdc++.h>
using namespace std;
const int N = 102;
const int K = 102;
const long long MOD = 1e6 + 3;
const long long MOD2 = MOD * MOD * 7LL;
struct Matrix {
  int mat[N][N];
  int row, col;
};
Matrix multiply(Matrix A, Matrix B) {
  Matrix ret;
  ret.row = A.row;
  ret.col = B.col;
  for (int i = 1; i <= ret.row; i++) {
    for (int j = 1; j <= ret.col; j++) {
      long long sum = 0;
      for (int k = 1; k <= A.col; k++) {
        sum += 1LL * A.mat[i][k] * B.mat[k][j];
      }
      ret.mat[i][j] = sum % MOD;
    }
  }
  return ret;
}
Matrix expo(Matrix base, long long p) {
  if (p == 1) return base;
  if (p & 1) return multiply(base, expo(base, p - 1));
  Matrix ret = expo(base, p / 2);
  return multiply(ret, ret);
}
long long c, h, w;
long long dp[N];
void init() {
  dp[0] = 1;
  for (int i = 1; i <= w; i++) {
    long long mul = 1;
    for (int j = 0; j <= w; j++) {
      if (i - j - 1 >= 0) dp[i] += mul * dp[i - j - 1];
      if (i - j == 0) dp[i] += mul;
      dp[i] %= MOD;
      mul *= h;
      mul %= MOD;
    }
  }
}
int main() {
  cin >> c >> w >> h;
  init();
  if (c <= w) {
    cout << dp[c] << endl;
    return 0;
  }
  Matrix base;
  base.row = w + 1;
  base.col = w + 1;
  memset(base.mat, 0, sizeof(base.mat));
  long long mul = 1;
  for (int i = 1; i <= w + 1; i++) {
    base.mat[1][i] = mul;
    mul *= h;
    mul %= MOD;
  }
  for (int i = 2; i <= w + 1; i++) {
    base.mat[i][i - 1] = 1;
  }
  Matrix ret = expo(base, c - w);
  long long ans = 0;
  for (int i = 1; i <= w + 1; i++) {
    ans += 1LL * ret.mat[1][i] * dp[w - i + 1], ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}
