#include <bits/stdc++.h>
using namespace std;
//const int m=1e9+7;
const int N=2e5+69;
#define mod 998244353
#define PI 3.14159265            
        
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb   push_back
#define sz(x) (ll)x.size()
#define mp   make_pair
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define pi pair<ll,ll>
const int64_t INF = 100000000000000018LL;
#define mems(x,v)       memset(x,v,sizeof(x))                      

///////////////////////////////// 
#define Toggle(n,i) (n^((ll)1<<i))
#define Check(n,i) (n&((ll)1<<i))
#define Set(n,i) (n|((ll)1<<i))
#define Reset(n,i) (n&(~((ll)1<<i)))
////////////////////////////////
/*ll ar[20];
ll sz;
//stack top hota h,queue front hota h
ll dp[20][2][5];
tuple <ll,ll,ll> kk;
map<kk,ll>dp;
ll rec(ll idx,ll edge,ll x)
{  if(x>r)return INT_MIN;
   if(x<=r)return x;
    ll limit = 9;
	if(!edge) limit = ar[idx];
    for(int i=0;i<=limit;i++)
	{
		if(edge || i < limit)
		{   
		    ans+=rec(idx+1,1,x+!!i);
		    
		}
		else
		{  
		    ans+=rec(idx+1,0,x+!!i);
		    
		}
	
	}
 
    return ans;
}
ll num(ll k)
{
	mems(dp,-1);
	sz=0;
	while(k)
	{
		ar[sz++]=k%10;
		k/=10;
	}
	reverse(ar, ar+sz);
	int ans=rec(0, 0, 0);
	return ans;
}
 
*/
ll n;
int dp[501][125255];
ll aa;
int rec(ll idx,ll k,ll sum,vector<ll>&v)
{
    if(sum==0&&k==0)
    return 1;
    if(sum<0||idx<=0||k==0||(idx)*(idx+1)/2<sum)
    return 0;
    if(dp[k][sum]!=-1)
    return dp[k][sum];
    ll x=rec(idx-1,k,sum,v);
    if(x==1)
    return dp[k][sum]=x;
    v.push_back(idx);
    x=rec(idx-1,k-1,sum-idx,v);
    if(x==1)
    return dp[k][sum]=x;
    v.pop_back();
    return dp[k][sum]=x;
    
}


void solve()
{
    ll l,r,i,s1;cin>>n>>l>>r>>s1;
    aa=n*(n+1)/2;
    vector<ll>v;
     for(i=1;i<=n;i++)
    for(ll j=0;j<=aa;j++)
    dp[i][j]=-1;
    rec(n,r-l+1,s1,v);
    
    if(sz(v)==0)
    {
        cout<<-1<<endl;return;
    }
    set<ll>s;
    for(auto it:v)
    {
        s.insert(it);
    }
    ll left=l-1;
    vector<ll>ans;
    for(i=1;i<=n&&left;i++)
    {
        if(s.count(i)==0)
        {ans.pb(i);
        s.insert(i);left--;
        }
    }
    for(auto it:v)
    ans.pb(it);
    left=n-r;
    for(i=1;i<=n&&left;i++)
    {
        if(s.count(i)==0)
        {ans.pb(i);
        s.insert(i);left--;
        }
    }
    for(auto it:ans)
    cout<<it<<" ";
    cout<<endl;
}
int main()
{ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   long long t=1;
cin >> t;
   while(t--)
   {solve();
   }
}