#include <bits/stdc++.h>
using namespace std;
long long ind[100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int t;
  cin >> t;
  for (int z = 1; z <= t; z++) {
    int n;
    cin >> n;
    long long l, r;
    cin >> l >> r;
    ind[0] = 0;
    for (int i = 1; i <= n; i++) {
      ind[i] = ind[i - 1] + 2 * (n - i);
    }
    vector<long long> res;
    long long p = 0;
    int j = 0;
    for (int i = 1; i <= n; i++) {
      if (ind[i] >= l) {
        int aL = l - ind[i - 1];
        p = aL / 2 + (aL % 2);
        j = i;
        break;
      }
    }
    if (l % 2 == 1) {
      res.push_back(j);
    }
    res.push_back(p + j);
    for (int i = p + j + 1; i <= n; i++) {
      res.push_back(j);
      res.push_back(i);
    }
    if (res.size() + 1 < r - l + 1) {
      int k = 0;
      for (int i = 1; i <= n; i++) {
        if (ind[i] >= r) {
          int aR = r - ind[i - 1];
          p = aR / 2 + (aR % 2);
          k = i;
          break;
        }
      }
      if (k == 0) {
        k = n;
      }
      j++;
      k--;
      int cnt = j;
      while (j < l) {
        res.push_back(j);
        cnt++;
        res.push_back(cnt);
        if (cnt == n) {
          j++;
          cnt = j;
        }
      }
      if (res.size() < r - l + 1) {
        for (int i = k + 1; i < p + k; i++) {
          res.push_back(j);
          res.push_back(i);
        }
        if (r % 2 == 1) {
          res.push_back(k);
        }
        res.push_back(p + k - 1);
      }
    }
    if (r == (n * (n - 1) + 1)) {
      res.push_back(1);
    }
    for (int i = 0; i < res.size(); i++) {
      cout << res[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
