#include<bits/stdc++.h>
using namespace std;

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; 

#define f first
#define s second
#define ll long long
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define vi vector<int>
#define vvi vector<vi>
#define rloop(i,a,b) for(ll i=a;i>b;i--)
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define pii pair<int,int>
#define mii map<int,int>
#define mll map<long long,long long>
#define msi map<string,int> 
#define vpii vector<pair<int,int>>
#define vll  vector<long long>
#define sz(a) int(a.size())
#define last(x) x.end()
#define beg(x) x.begin()
#define all(x) begin(x),end(x) 
#define FindInTree(m,n) m.find(n)!=m.end()
#define ull unsigned long long
#define inp(a,n) loop(i,0,n) cin>>a[i]
#define db1(x) cerr<<#x<<" = "<<x<<endl
#define db2(x,y) cerr<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<endl
#define db3(x,y,z) cerr<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<endl
#define divs(n,m) ((m!=0)&&(n%m==0))
#define sum(container,value) accumulate(begin(container),end(container),value)
#define tr(container,it)\
for(__typeof(container.begin()) it=container.begin();it!=container.end();it++)

#define print(container) tr(container,it){cout<<*it<<" ";cout.flush();}cout<<endl
#define printarr(a,n) loop(i,0,n){ cout<<a[i]<<" ";cout.flush(); }cout<<endl
#define ordered_set(datatype,comp) tree<datatype, null_type, comp<datatype>, rb_tree_tag, tree_order_statistics_node_update>

#pragma GCC optimise ("Ofast") 



const int mod=1e9+7;
const int N=1e5+5;
const double PI=3.14159265358979311600;

int Ecycle[N];

ll binomialCoeff(ll n, ll k) 
{ 
    ll res = 1; 
    if(n<k)
      return 0;
     
    if ( k > n - k ) 
        k = n - k; 
  
    
    for (ll i = 0; i < k; ++i) 
    { 
        res *= (n - i);  
        res /= (i + 1); 
    } 
  
  return res; 
} 

ll countDigitsAccurate(ll num,int base)
{
  ll cnt=0;
  while(num>0)
  {
    cnt++;
    num=num/base;
  }
  return cnt;
}
 
vll generate(ll n)
{
  vll ans;
  /*if(n==2)
  {
    ans.pb(1);
    ans.pb(2);
    return ans;
  }
  else if(n>2)
  {
    v.pb(1);
    v.pb(n);
    loop(i,2,n-1)
      v.pb(i);
    ans=v;

    ans.pb(n-1);
    //print(ans);
    reverse(beg(v),last(v));
    //copy(beg(v),last(v),last(ans));
    for(ll u:v)
      ans.pb(u);
    //print(ans);
    ans.ppb();
  }*/
  loop(i,1,n)
  {
    ans.pb(i);
    ans.pb(n);
  }
  return ans;
}

vll processBeg(ll l,ll lb)
{
  ll begPtr;
  vll vlb;
  vlb=generate(lb);
  //stack<int> stk;
  //cout<<"lb is: "<<lb<<endl;
  //print(vlb);
  begPtr=(lb-1)*(lb-2)+1;
  //while(begPtr<l)
  //{
    //stk.pop();
    //begPtr++;
  //}
  vll::iterator it=beg(vlb);
  advance(it,l-begPtr);
  vll ans(it,last(vlb));
  return ans;
}

vll processMiddle(ll start,ll stop)
{
  vll ans,segment;
  loop(i,start,stop+1)
  {
    segment=generate(i);
    //copy(beg(segment),last(segment),last(ans));
    for(ll u:segment)
      ans.pb(u);
  }
  return ans;
} 

vll processEnd(ll r,ll ub)
{
  ll endPtr;
  vll vub;
  vub=generate(ub);
  endPtr=ub*(ub-1);
  while(endPtr>r)
  {
    vub.ppb();
    endPtr--;
  }
  return vub;
}

ll findInterval(ll n)
{
  ll interval;
  ll Discriminant=1+4*n;
  interval=ceil((1+sqrtl(Discriminant))/2.0);
  db1(interval);
  //if((interval*(interval-1))==n)
    //interval--;
  return interval;
}
/*void preProcess()
{
  int term,lim,ptr,L,R,mid;
  cout<<"In preProcess function"<<endl;
  term=sqrt(N);
  lim=2*term+1;
  Ecycle[1]=1;
  ptr=3;
  L=2;
  R=4;
  while(ptr<=lim&&R<99855)
  {
    cout<<L<<" "<<R<<endl;
    mid=(R+L)/2;
    loop(i,L,mid)
    {
      if((i-L)!=1)
        Ecycle[i]=Ecycle[i-(ptr-2)];
      else
        Ecycle[i]=(ptr+1)/2;
    }
    Ecycle[mid]=(ptr-1)/2;
    loop(i,mid+1,R+1)
    {
      Ecycle[i]=Ecycle[2*mid-i];
    }
    ptr+=2;
    L=R+1;
    R=L+ptr-1;
  }
  Ecycle[3]=2;
  loop(i,1,50)
  {
    cout<<Ecycle[i]<<" ";
  }
  cout<<endl;
}*/

void solve()
{
  //Declare your variables here.
  ll n,l,r,endPtr,lb,ub;
  vll left,middle,right,ans;
  //Do not assign values to the variables here!!!
  cin>>n>>l>>r;
  lb=findInterval(l);
  ub=findInterval(r);
  db2(lb,ub);
  if(ub<lb)
    return;
  left=processBeg(l,lb);
  if((ub-lb)>1)
    middle=processMiddle(lb+1,ub-1);
  right=processEnd(r,ub);

  //print(left);
  //print(middle);
  //print(right);

  if((ub-lb)>1)
  {
    ans=left;
    //copy(beg(left),last(left),last(ans));
    //ans.resize(sz(middle)+sz(ans)+5);
    //copy(beg(middle),last(middle),last(ans));
    //ans.resize(sz(right)+sz(ans)+5);
    //copy(beg(right),last(right),last(ans));
    for(int u:middle)
      ans.pb(u);
    for(int u:right)
      ans.pb(u);
  }
  else if((ub-lb)==1)
  {
    ans=left;
    //copy(beg(left),last(left),last(ans));
    //ans.resize(sz(right)+sz(ans)+5);
    //copy(beg(right),last(right),last(ans));
    for(int u:right)
      ans.pb(u);
  }
  else
  {
    endPtr=ub*(ub-1);
    ans=left;
    while(endPtr>r)
    {
      ans.ppb();
      endPtr--;
    }
  }
  /*loop(i,l,r+1)
  {
    cout<<Ecycle[i]<<" ";
  }
  cout<<endl;
  */
  //cout<<"answer is:"<<endl;
  print(ans);
}

int main()
{
  ios_base::sync_with_stdio(false); 
  cin.tie(NULL);
  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);
  #endif
  int t=1;
  cin>>t;
  //preProcess();
  while(t--)
    solve();
}
