#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

int main() {
	//freopen ("input.txt","r", stdin);
	//freopen ("output.txt","w", stdout);
	cin.tie(0);
	cin.sync_with_stdio(false);
	int t;
	cin >> t;
	while (t > 0) {
		t--;
		long long n, k;
		cin >> n >> k;
		k--;
		int a[n];
		for (int i = 0; i < n; ++i) {
			a[i] = 0;
		}
		int i = 1;
		while (k > 0) {
			if (i >= n) {
				break;
			}
			a[i] = k % 2;
			k /= 2;
			i++;
		}
		if (k > 0 && i >= n) {
			cout << -1 << endl;
			continue;
		}
		i = n - 1;
		while (i >= 0) {
			if (a[i] == 0) {
				cout << n - i << ' ';
				i--;
			}
			else {
				int t = i;
				while (a[i] == 1) {
					i--;
				}
				for (int k = n - i; k >= n - t; --k) {
					cout << k << ' ';
				}
				i--;
			}
		}
		cout << endl;
	}
	return 0;
}