#include "redica.h"
#include <bits/stdc++.h>


using namespace std;

const int MAXN = 300;
const int MAXSUM = 90000;

int suma, n, k;
long long dp[MAXN + 5][MAXSUM + 5];

int operations = 0;

void rec(int pos, int sum, vector<int>& curr)
{
    if(pos == n)
    {
        if(suma == sum)
        {
            submit(curr);
        }
        return;
    }

    for(int i = 1; i <= k; i++)
    {
        if(sum + i <= suma)
        {
            curr[pos] = i;
            rec(pos + 1, sum + i, curr);
        }
        else break;
    }
}

void solve(int N, int K, int s)
{
    //query()
    //submit(vector<int>a)
    suma = s;
    n = N; k = K;
    vector<int>a(n + 5, 0);
    
    dp[0][0] = 1;
    for(int i = 1; i <= n; i++)
    {
        for(int j = 1; j <= k; j++)
        {
            for(int sum = s; sum >= 0; sum--)
            {
                if(sum > j)continue;
                dp[i][sum] += dp[i - 1][sum - j];
            }
        }
    }

    int suma = 0;
    vector<int>ans;
    for(int i = 1; i <= n; i++)
    {
        int sum = s - suma, br = 0, idx = 0;
        
        for(int j = 1; j <= k; j++)
        {
            if(sum < j)break;
            if(dp[i - 1][sum - j] != 0)
            {
                br++;
                idx = j;
            }
        }
        
        
        if(br == 1)
        {
            ans.push_back(idx);
            suma += x;
        }
        else 
        {
            //оу шит това не е вярно
            int x = query();
            ans.push_back(x);
            suma += x;
        }
        
    }
    
    submit(ans);
}
