#include <iostream>

using namespace std;

#define ll long long
#define MAXN 100100

int t;
ll n, k;
ll ans[MAXN];

void solve(int c, ll remk) {

	if (c > n) return;

	// cout << c << "-> " << remk << endl;

	int res = 0;
	ll undersofar = 0;
	for (int sz = 1; sz + c - 1 < n; sz++) {

		int rem = n - c + 1 - sz;
		if (rem >= 62 || 
			(rem?(1ll << (rem - 1)):0) + undersofar >= remk) break;

		res++;
		undersofar += (1ll << (rem - 1));

	}

	// cout << "res " << res << ", under: " << undersofar << endl;

	for (int i = c; i <= c + res; i++) {
		ans[i] = c + res - (i - c);
	}

	solve(res + c + 1, remk - undersofar);

}

int main() {

	scanf("%d", &t);
	while (t--) {
		scanf(" %lld%lld", &n, &k);

		if (n < 63 && (1ll << (n-1)) < k) {
			printf("-1\n");
			continue;
		}

		solve(1, k);
		for (int i = 1; i <= n; i++)
			printf("%lld ", ans[i]);
		printf("\n");


	}

}