#include "redica.h"
#include<bits/stdc++.h>
using namespace std;

int n, k, s;
int sum; vector<int>v;
void rec(){
    if(v.size() == n){ submit(v); return;}
    for(int i = 1; i <= k; i++){
        if(sum + i > s)continue;
        sum += i; v.push_back(i);
        rec();
        sum -= i; v.pop_back();
    }
}

void solve(int N, int K, int S) {
    n = N; k = K; s = S;
    sum = 0;
    for(int i = 0; i < n - 10; i++){
        int f = query();
        v.push_back(f);
        s -= f;
    }
        //submit(v);
    rec();
}
