// Problem: E. Permutation by Sum
// Contest: Codeforces - Codeforces Round #713 (Div. 3)
// URL: https://codeforces.com/contest/1512/problem/E
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define vi vector<ll>
#define vc vector<char>
#define vvi vector<vector<ll>>
#define MAX 1e10
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define MIN -1e10
#define s(a) sort(a.begin(),a.end())
#define pq priority_queue<ll>
#define npq priority_queue<ll, vector<ll>, greater<ll>>
//Global Variable Definition.....
//Union Find

void abcd() {
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n,l,r,s;
	cin>>n>>l>>r>>s;
	ll diff=r-l+1;
	ll low=(diff*(diff+1))/2,high=(diff*(2*n-(diff-1)))/2;
	if(s<low or s>high) {
		cout<<-1;
		return;
	}
	vector<bool> used(n+1,false);
	vi ans1,ans2;
	ll req=0;
	for(ll i=1;i<=diff;i++) {
		ans1.push_back(i);
		used[i]=true;
		req+=i;
	}
	ll ind=diff-1;
	while(req!=s) {
		used[ans1[ind]]=false;
		ll sea;
		req-=ans1[ind];
		for(ll i=ans1[ind]+1;i<=n;i++) {
			if(!used[i]) {
				if(req+i<=s) sea=i;
				else break;
			}
		}
		req+=sea;
		ans1[ind]=sea;
		used[ans1[ind]]=true;
		ind--;
	}
	for(ll i=1;i<=n;i++) {
		if(!used[i]) ans2.push_back(i);
	}
	ll a=ans1.size(),b=ans2.size();
	ll x=0;
	for(ll i=1;i<=n;i++) {
		if(i==l) {
			for(auto x:ans1) cout<<x<<" ";
			i+=a-1;
		}
		else {
			cout<<ans2[x]<<" ";
			x++;
		}
	}
}
int main() {
	ll t;
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>t;
	while(t--) {
		abcd();
		cout<<endl;
	}
}