#include <bits/stdc++.h>
using namespace std;
template <typename R>
R read(R &x) {
  x = 0;
  char c = getchar();
  R f = 1;
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x = x * f;
}
template <typename W>
void write(W x) {
  if (x < 0) x = (~x) | 1, putchar('-');
  if (x > 9) write(x / 10);
  putchar((x - (x / 10) * 10) + 48);
}
int T;
long long n, l, r, al1, al2;
int main() {
  read(T);
  for (; T--;) {
    read(n), read(l), read(r);
    long long tot = 0;
    for (int i = n - 1; i >= 0; i--) {
      tot += i * 2;
      if (i == 0) tot++;
      if (tot >= l) {
        al2 = n - i;
        if (l & 1) {
          al1 = (n - i) + (l + 1 - (tot - 2 * i)) / 2;
        } else {
          al1 = (n - i) + (l - (tot - 2 * i)) / 2;
        }
        tot -= i * 2;
        break;
      }
    }
    for (long long i = l; i <= r; i += 2) {
      if (i & 1) {
        if (i == r)
          printf("%lld\n", al2);
        else
          printf("%lld\n%lld\n", al2, al1);
        al1++;
        if (al1 > n) {
          al2++;
          if (al2 == n) al2 = 1;
          al1 = al2 + 1;
        }
      } else {
        printf("%lld\n", al1);
        al1++;
        if (al1 > n) {
          al2++;
          if (al2 == n) al2 = 1;
          al1 = al2 + 1;
        }
        if (i != r) printf("%lld\n", al2);
      }
    }
  }
}
