func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 105;   const int MOD = 1e6 + 3;   struct matrix {     int val[M][M];     int n;     matrix(int nn, int x = 0) {       n = nn;       for (int i = 0; i < n; i++)         for (int j = 0; j < n; j++)           if (i != j)             val[i][j] = 0;           else             val[i][j] = x;     }     int* operator[](int x) { return val[x]; }     matrix operator*(matrix b) {       matrix ans(n, 0);       for (int i = 0; i < n; i++)         for (int j = 0; j < n; j++)           for (int k = 0; k < n; k++)             ans[i][k] += 1LL * val[i][j] * b[j][k] % MOD, ans[i][k] %= MOD;       return ans;     }   };   matrix operator^(matrix a, long long b) {     matrix ans(a.n, 1);     while (b) {       if (b & 1) ans = ans * a;       a = a * a;       b >>= 1;     }     return ans;   }   int main() {     long long n;     int w, h;     cin >> n >> w >> h;     matrix mat(w + 1, 0);     for (int i = 0; i < w; i++) mat[i][i + 1] = 1;     int k = 1;     for (int i = w; i >= 0; i--) {       mat[w][i] = k;       k = 1LL * k * h % MOD;     }     mat = mat ^ n;     cout << (mat[w][w - 1] + mat[w][w]) % MOD <<   n ;     return 0;   }   