#include using namespace std; #include using namespace atcoder; // #include // using namespace boost::multiprecision; #define ll long long #define ld long double #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define vi vector #define vl vector #define vd vector #define vb vector #define vs vector #define vc vector #define ull unsigned long long #define chmax(a, b) a = max(a, (b)) #define chmin(a, b) a = min(a, (b)) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() // #define ll int // #define ll int128_t // #define ll int256_t // #define ll cpp_int constexpr ll inf = (1ll << 60); // constexpr ll inf = (1 << 30); // const double PI=3.1415926535897932384626433832795028841971; // ll rui(ll a,ll b){ // if(b==0)return 1; // if(b%2==1) return a*rui(a*a,b/2); // return rui(a*a,b/2); // } // vl fact; // ll kai(ll n){ // fact.resize(n,1); // rep(i,n-1)fact[i+1]=fact[i]*(i+1); // } // using mint = modint998244353;//static_modint<998244353> // using mint = modint1000000007;//static_modint<1000000007> // using mint = static_modint<922267487>; // 多分落とされにくい NOT ntt-friendly // using mint = static_modint<469762049>; // ntt-friendly // using mint = static_modint<167772161>; // ntt-friendly // using mint = modint;//mint::set_mod(mod); // ll const mod=1000000007ll; // ll const mod=998244353ll; // ll modrui(ll a,ll b,ll mod){ // a%=mod; // if(b[i]==0)return 1; // if(b%2==1) return a*modrui(a*a%mod,b/2,mod)%mod; // return modrui(a*a%mod,b/2,mod)%mod; // } // ll inv(ll x){ // x%=mod; // return modrui(x,mod-2); // } // void incr(vl &v,ll n){// n進法 // ll k=v.size(); // v[k-1]++; // ll now=k-1; // while (v[now]>=n) // { // v[now]=0; // if(now==0)break; // v[now-1]++; // now--; // } // return; // } // vector fact,invf; // void init_modfact(ll sz){ // fact.resize(sz); // invf.resize(sz); // fact[0]=1; // rep(i,sz-1){ // fact[i+1]=fact[i]*(i+1); // } // invf[sz-1]=1/fact[sz-1]; // for(ll i=sz-2; i>=0; i--){ // invf[i]=invf[i+1]*(i+1); // } // } // mint choose(ll n,ll r){ // if(n modpow,invpow; // void init_modpow(ll x,ll sz){ // mint inv=1/mint(x); // modpow.assign(sz,1); // invpow.assign(sz,1); // rep(i,sz-1){ // modpow[i+1]=modpow[i]*x; // invpow[i+1]=invpow[i]*inv; // } // } //http://atcoder.jp/contests/abc236/submissions/73613608 //https://judge.yosupo.jp/submission/355510 template struct Matrix { using T = typename S::T; int h, w; std::vector> val; // zero() で初期化 Matrix(int h, int w) : h(h), w(w), val(h, std::vector(w, S::zero())) {} // 単位行列の生成(対角成分を one() にする) static Matrix eye(int n) { Matrix res(n, n); for (int i = 0; i < n; i++) res.val[i][i] = S::one(); return res; } // 行列同士の積 Matrix operator*(const Matrix& a) const { assert(w == a.h); Matrix res(h, a.w); for (int i = 0; i < h; i++) { for (int k = 0; k < w; k++) { for (int j = 0; j < a.w; j++) { // res[i][j] += val[i][k] * a[k][j] の抽象化 res.val[i][j] = S::add(res.val[i][j], S::mul(val[i][k], a.val[k][j])); } } } return res; } // ベクトルへの線形変換 (Matrix * Vector) std::vector operator*(const std::vector& vec) const { assert(w == vec.size()); std::vector res(h, S::zero()); for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { res[i] = S::add(res[i], S::mul(val[i][j], vec[j])); } } return res; } // 行列の累乗(ダブリング) Matrix pow(long long k) const { assert(h == w); Matrix res = eye(h); Matrix a = *this; while (k > 0) { if (k & 1) res = res * a; a = a * a; k >>= 1; } return res; } }; using mint = static_modint<10007>; // using mint = double; struct Semiring { using T = mint; // modint998244353 などに変えるだけ static T add(T &a, T &b) { return a+b; } static T mul(T &a, T &b) { return a*b; } static T zero() { return 0; }// addの単位元 static T one() { return 1; }// mulの単位元 }; void solve(){ ll k,s,n; cin >> k >> s >> n; vector a(k+1,0); a[k]=s; vector f(k+1); mint s0=1,s1=1; rep(j,k+1){ f[k-j]=1/s0; mint s2=s0+s1; s0=s1; s1=s2; } rep(i,n-1){ mint ret=0; rep(j,k+1){ ret+=a[a.size()-1-j]*f[k-j]; } a.push_back(ret); } cout << a.back().val() << endl; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll t = 1; // cin >> t; while (t--) solve(); }