#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
typedef long long ll;
int p[N],a[N];
bool check(ll k,int n){
	int c=0;ll p=k;
	while(k) k/=2,++c;
	if(c<n) return 0;
	return p>(1ll<<n);
}
signed main(){
	ios::sync_with_stdio(false);
	int T,n;
	cin>>T;ll k;
	while(T--){
		cin>>n>>k;
		int cnt=0,c=0;
		for(int i=1;i<=n;++i) p[i]=i;
		if(n<61 && k>(1ll<<(n-1))){cout<<-1<<endl;continue;
		}
		int p=max(0,n-61);
		for(int i=1;i<=p;++i) cout<<i<<" ";
		n=min(n,61);
		int pos=1;
		while(pos<=n){
			int las=0;
			for(int j=pos;j<=n;++j)
				if(k>1ull<<max(0,n-j-1)) k-=1ull<<max(0,n-j-1);
				else{las=j;break;}
			for(int j=las;j>=pos;--j) cout<<j+p<<" ";
			pos=las+1; 
		}
		cout<<endl;
	}
	return 0;
} 