#include "bits/stdc++.h"
using namespace std;

#define ll long long 
const int MAXN = 2e5 + 5;
const ll MAXK = 1e18;

int n;
ll K, e2[MAXN];
int t;

void gen2() {
	e2[0] = 1;
	for(int i = 1; i < MAXN; ++i) {
		e2[i] = min(e2[i-1]*2, 2*MAXK);
	}
}

void solve(int siz, ll idx, int offset) {
	// printf("solve(%d, %lld, %d)\n", siz, idx, offset);
	if(siz == 0) {
		printf("\n");
		return;
	}
	if(siz == 1) {
		printf("%d\n", offset+1);
		return;
	}
	ll comb = e2[siz-1];
	ll tmp = 0;
	for(int i = siz-2, j = 1; i >= 0; --i, ++j) {
		tmp += e2[i];
		// printf("[%lld]", tmp);
		if(tmp >= idx) {
			// printf("\n");
			for(int k = j; k > 0; --k) {
				printf("%d ", offset+k);
			}
			solve(siz-j, idx-tmp+e2[i], offset+j);
			return;
		}
	}
	for(int i = siz; i >= 1; --i) printf("%d ", offset+i);
	printf("\n");
}

int main() {
	gen2();
	scanf("%d", &t);
	while(t--) {
		scanf("%d %lld", &n, &K);
		if(K > e2[n-1]) {
			printf("-1\n");
			continue;
		}
		// printf("SOLVE\n");
		solve(n, K, 0);
	}
}