#include using namespace std; using ll = long long; bool chmax(auto &a, auto b) { return a < b ? a = b, 1 : 0; } bool chmin(auto &a, auto b) { return a > b ? a = b, 1 : 0; } template struct modint { using M = modint; ll x; modint() : x(0) {} constexpr modint(ll v) : x(v % MOD) { if (x < 0) x += MOD; } ll val() { return x; } static constexpr ll mod() noexcept { return MOD; } friend M operator+(M a, M b) { return a.x + b.x; } friend M operator-(M a, M b) { return a.x - b.x; } friend M operator*(M a, M b) { return a.x * b.x; } friend M operator/(M a, M b) { return a * b.inv(); } friend M operator+=(M& a, M b) { return a = a + b; } friend M operator-=(M& a, M b) { return a = a - b; } friend M operator*=(M& a, M b) { return a = a * b; } friend M operator/=(M& a, M b) { return a = a / b; } friend bool operator==(M a, M b) { return a.x == b.x; } friend bool operator!=(M a, M b) { return a.x != b.x; } M operator+() { return *this; } M operator-() { return M() - *this; } M inv() const { ll a = x, b = MOD; ll u = 1, v = 0; while (b > 0) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } return u; } }; using mint = modint<10007>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int K; ll S, N; cin >> K >> S >> N; vector F(N + 1); F[0] = F[1] = 1; for (int i = 2; i <= N; ++i) F[i] = F[i - 1] + F[i - 2]; vector v(N + 1); v[1] = S; for (int i = 1; i < N; ++i) { for (int j = max(1, i - K); j <= i; ++j) { v[i + 1] += v[j] * F[i - j].inv(); } } // for (int i = 0; i <= N; ++i) cout << v[i].val() << " \n"[i == N]; cout << v[N].val() << '\n'; }