#include<iostream>
#include<vector>
#include"redica.h"
using namespace std;
vector<int> ans;
void rec(int cur, int curSum, int N, int K, int S)
{
    if(cur == N)
    {
        if(curSum != S) return;
        submit(ans);
        return;
    }
    for(int i = 1; i <= K; i++)
    {
        ans.push_back(i);
        rec(cur+1, curSum+i, N, K, S);
        ans.pop_back();
    }
}
void solve(int N, int K, int S)
{
    if(N <= 7) 
    {
        rec(0, 0, N, K, S);
        return;
    }
    if(S == N*K)
    {
        for(int i = 0; i < N; i++)
        {
            ans.push_back(K);
        }
        submit(ans);
        return;
    }
    int sum = 0;
    for(int i = 0; i < 10; i++)
    {
        ans.push_back(query());
        sum+=ans.back();
    }
    rec(10, sum, N, K, S);
}