#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return a > b ? a : b; }
void get_arr(int l, int* a) {
  int d = l / 4;
  if (l % 4 == 0) d--;
  a[0] = 1;
  a[1] = d + 3;
  a[2] = d + 2;
  a[3] = d + 3;
}
long long get_l(vector<int>& ans, long long l, long long s) {
  if (l == 2) {
    cout << "2 ";
    return 3;
  }
  if (l == 1) {
    if (s == 1) {
      cout << "1 ";
      return 2;
    } else {
      cout << "1 2 ";
      return 3;
    }
  }
  int a[4];
  get_arr(l - 2, a);
  int ql = (l - 3) % 4;
  for (int j = 0, i = ql; j < s && i < 4; j++, i++) cout << a[i] << " ";
  return l + (4 - ql);
}
long long solve() {
  long long l, r, n;
  cin >> n >> l >> r;
  long long s = r - l + 1;
  vector<int> ans(s);
  l = get_l(ans, l, s);
  s = r - l + 1;
  for (int i = l; s > 0; i++) {
    int a[4];
    get_arr(l, a);
    for (int i = 0; i < 4 && i < s; i++) cout << a[i] << " ";
    s = s - 4;
  }
  cout << endl;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
