#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define int long long
int T, n, k;
void work (int l, int r, int k)
{
	if (l > r)
		return;
	int t = ceil(log2(k)) + 1, cnt = 0;
	for (int i = l; i <= r - t; i++) cout << i << " ";
	for (int i = 62; i >= 0; i--)
	{
		if ((1ll << i) < k)
			k -= (1ll << i), cnt++;
		else if (cnt) break;
	}
	for (int i = r - t + cnt + 1; i > r - t; i--) cout << i << " ";
	work (r - t + cnt + 2, r, k);
}
signed main()
{
	cin >> T;
	while (T--)
	{
		cin >> n >> k;
		int t = ceil(log2(k)) + 1;
		if (n < t || (n <= 62 && (1ll << (n - 1)) < k))
		{
			cout << "-1" << endl;
			continue;
		}
		work(1, n, k);
		cout << endl;
	}
}