#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define endl '\n'

using namespace std;

int t; 
void read()
{
	cin >> t;
}

const int maxn = 1e5 + 3; 

int n;
long long k;
long long f[maxn];

void print(int n, long long k, int add)
{
    if (n == 0)
        return;

    for (int i = 1; i <= n; i++)
    {
        if (f[n-i] >= k)
        {
            for (int j = i; j >= 1; j--)
                cout << j + add << " ";

            print(n - i, k, add + i);
            
            break;
        }

        k -= f[n-i];
    }
}

void solve()
{
    while (t--)
    {
        cin >> n >> k;
        f[0] = 1;
        f[1] = 1; 
        for (int i = 2; i <= n; i++)
        {
            if (f[i-1] >= k)
                f[i] = f[i-1];

            else 
                f[i] = f[i-1] + f[i-1];
        }

        if (f[n] < k)
        {
            cout << -1 << endl;
            continue;
        }

        print(n, k, 0);
        cout << endl;
    }
}    

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	
	read();
	solve();
}
