#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,i,val=1;
        cin>>n;
        cout<<n<<" ";
        for(i=1;i<n;i++){
            cout<<val<<" ";
            val++;
        }
        cout<<endl;
    }
    return 0;
}