#include<bits/stdc++.h>
#define int long long
using namespace std;
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--)
    {int n,k;
     cin>>n>>k;
     int ok=1;
     int poss=0;
     for(int i=0;i<n-1;i++)
        {ok=ok*2;
         if(ok>=k){poss=1;break;}
        }
    if(ok<k){cout<<"-1\n";continue;}
    vector<int> v;
    k--;
    for(int i=0;i<n-1;i++)
        {//Should I take i+1
         int poss=0;
         int z=1;
         for(int j=0;j<n-i-2;j++)
            {z=z*2;
             if(z>k){break;}
            }
        if(z>k)
            {v.push_back(i+1);
            }
        else
            {k-=z;
            }
        }
    v.push_back(n);
    int visited[n];
    memset(visited,0,sizeof(visited));
    for(auto x:v)
        {
            visited[x-1]=1;
            cout<<x<<" ";
            for(int i=x-1;i>0;i--)
                {
                    if(visited[i-1]==1){break;}
                    cout<<i<<" ";
                }
        }
    cout<<"\n";
    }
}

