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


using namespace std;

int suma, n, k;
vector<int>curr;
int operations = 0;

void rec(int pos, int sum)
{
    operations++;
    if(pos == n)
    {
        if(suma == sum)
        {
            submit(curr);
        }
        return;
    }
    
    for(int i = 1; i <= k; i++)
    {
        if(sum + i <= suma)
        {
            curr.push_back(i);
            rec(pos + 1, sum + i);
            curr.pop_back();
        }
        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;
    for(int i = 0; i < 1; i++)
    {
        ans.push_back(query());
        sum += ans.back();
    }
    
    curr = ans;
    rec(ans.size(), sum);
}
