#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int cases;
  cin >> cases;
  while (cases--) {
    long long int n, l, r;
    cin >> n >> l >> r;
    l--;
    r--;
    long long int curr_step = 1;
    long long int step_len, curr_step_start, curr_step_end;
    long long int last_step_end = -1;
    while (true) {
      step_len = curr_step * 2;
      curr_step_start = last_step_end + 1;
      curr_step_end = curr_step_start + step_len - 1;
      if (curr_step_start <= l && l <= curr_step_end) {
        break;
      }
      curr_step++;
      last_step_end = curr_step_end;
    }
    long long int curr_index = l - curr_step_start;
    while (l <= r) {
      if (curr_index % 2) {
        cout << curr_step + 1 << " ";
      } else {
        cout << (curr_index / 2) + 1 << " ";
      }
      curr_index++;
      l++;
      if (curr_index == step_len) {
        curr_step++;
        step_len = curr_step * 2;
        curr_index = 0;
      }
    }
    cout << endl;
  }
}
