#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+1, N, K, S);
        ans.pop_back();
    }
}
void solve(int N, int K, int S)
{
    rec(0, 0, N, K, S);
}