#include "redica.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> v;
int n,k,s;
void dfs(int sum,int beg,int pos)
{
    if(sum<0)return;
    if(pos==n)
    {
        if(sum>k)return;
        if(sum<0)return;
        v.push_back(sum);
        dfs(0,sum,pos+1);
        v.pop_back();
        return;
    }
    if(pos==n+1)
    {
        submit(v);
        return;
    }
    v.push_back(beg);
    for(int i=1;i<=min(k,sum-beg);i++)
    {
        dfs(sum-beg,i,pos+1);
    }
    v.pop_back();
}
void solve(int n, int k, int s)
{
    ::n=n;
    ::k=k;
    for(int i=1;i<=n-6;i++)
    {
        int ve=query();
        v.push_back(ve);
        s-=ve;
    }
    for(int i=1;i<=k;i++)
    {
        if(i<=s)
        {
            dfs(s,i,max(n-6,1));
        }
    }
}
