#include "redica.h"
#include<bits/stdc++.h>
using namespace std;

const int MAXN = 307, MAXS = MAXN*MAXN, THR = 1e5;
int n, k, s, dp[MAXN][MAXS], a[MAXN], idx;
vector<int> v;

void brute(int pos, int sum)
{
    if(sum > s)return;
    if(pos == n+1)
    {
        if(sum == s) submit(v);
        return;
    }
    for(int i = 1; i <= k && i+sum <= s; i++)
    {
        idx++;
        v[idx] = i;
        brute(pos+1, sum+i);
        idx--;
    }
    return;
}

void solve(int N, int K, int S)
{
    n = N;
    k = K;
    s = S;
    for(int j = max(0LL, s-k); j <= s-1; j++)
    {
        dp[n][j] = 1;
    }
    for(int i = n-1; i >= 1; i--)
    {
        for(int j = 0; j <= s; j++)
        {
            for(int jj = j+1; jj <= min(s, j+k); jj++)
            {
                dp[i][j] += dp[i+1][jj];
                if(dp[i][j] > THR) dp[i][j] = THR+1;
            }
        }
    }
    v.resize(n);
    idx = -1;
    int sum = 0;
    for(int i = 0; i <= n; i++)
    {
        if(dp[i+1][sum] <= THR)
        {
            brute(i+1, sum);
            break;
        }
        a[i+1] = query();
        sum += a[i+1];
        v[i] = a[i+1];
        idx = i;
    }
    return;
}
