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


using namespace std;

int suma, n, k;

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;

    int sum = 0;
    vector<int>ans(n);

    int w = 7;

    for(int i = 0; i < w; i++)
    {
        ans[i] = query();
        sum += ans[i];
    }

    rec(w, sum, ans);
}
