# include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
# define f first
# define s second
# define pb push_back
# define sz(a) int((a).size())
const double PI = 3.1415926535897;
const int M = 1e5+5;
const ll mod = 1e9+7;
const ll INF = 1e9;

int solve()
{
	ll n,k;
	cin>>n>>k;
	k--;
	int bin[n];

	for(int i=n-1;i>0;i--)
	{
		bin[i] = k&1ll;
		k >>= 1;
	}
	bin[n] = 0;
	
	if(k>0)return !(cout<<"-1\n");

	int ans[n+1];
	for(int i=1;i<=n;i++)
		ans[i]=i;

	int p = 1;
	for(int i=1;i<=n;i++)
	{
		if(!bin[i])
		{
			reverse(ans+p,ans+i+1);
			p = i+1;
		}
	}

	for(int i=1;i<=n;i++)
		cout<<ans[i]<<" ";
	cout<<"\n";
	return 0;
}

int main()
{
	cin.sync_with_stdio(false);
	cin.tie(0);

	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	
	int t=1,i=1;
	cin>>t;
	while(t--)
	{
		//cout<<"Case #"<<i++<<": ";
		solve();
	}

	return 0;
}