#include "redica.h"
#include <bits/stdc++.h>
using namespace std;
vector<int>V;
vector<int>ot;
int n,k,s,sum;
bool check()
{
    if((s-sum)-(n-ot.size())>=20&&n-ot.size()>=20)return false;
    if((s-sum)-(n-ot.size())<=20&&n-ot.size()<=20)return true;
    if(n-ot.size()<=3)return true;
    if((n-ot.size())*k<=1e5)return true;
    return true;
}
void rec(int step,int sum)
{
    if(step==n+1)
    {
        submit(V);
        return;
    }
    for(int i=max(1,s-sum-(n-step)*k);i<=k;i++)
    {
        if(sum+i+n-step>s)return;
        //if(s-sum-i>(n-step)*k)continue;
        V.push_back(i);
        rec(step+1,sum+i);
        V.pop_back();
    }
}
void solve(int N, int K, int S)
{
    n=N;
    k=K;
    s=S;
    while(!check())
    {
        V.push_back(query());
        ot.push_back(V.back());
        sum+=ot.back();
    }
    rec(ot.size()+1,sum);
}
